initial commit of already existing scripts

This commit is contained in:
2015-06-12 11:42:25 +03:00
commit 92bf42faec
7 changed files with 1017 additions and 0 deletions

44
clients/initialsetup.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Run this after every fresh Linux install in MIT
# Check for root privileges
if [ $EUID -ne 0 ]; then
echo "This script need root privileges. Please start it with sudo $(basename $0) or get a root shell with sudo -s"
exit 1
fi
if [ "$1" = "reset" ]; then
echo "Configuring apt to NOT use local apt-cacher-ng proxy"
mv /etc/apt/apt.conf.d/01proxy /etc/apt/apt.conf.d/01proxy.bak
exit 0
fi
# Disable timeout in grub
echo "Update GRUB timeout to unlimited"
cp /etc/default/grub /etc/default/grub.bak
sed "s|^GRUB_TIMEOUT=.*$|GRUB_TIMEOUT=-1|" /etc/default/grub > grub.tmp ; mv grub.tmp /etc/default/grub
update-grub
# Set apt-cacher-ng proxy
echo "Configuring apt to use local apt-cacher-ng proxy"
echo 'Acquire::http { Proxy "http://192.168.1.250:3142"; };
Acquire::https { Proxy "https://"; };' > "/etc/apt/apt.conf.d/01proxy"
killall apt-get
# apt-get update "offline"
#mv /var/lib/apt/lists /var/lib/apt/lists.old
#mv lists /var/lib/apt/
apt-get update
# Reset GUI settings on every login (XFCE)
USER=$(grep ":1000:" /etc/passwd | awk -F: '{ print $1 }')
sed -i "/^exit 0/irm -rf \/home\/$USER\/.config\/xfce4\/xfconf\/xfce-perchannel-xml\/*" /etc/rc.local
# Final instructions
echo
echo "Please disable automatic update checks in: Menu > Preferences > Software & Updates > Updates > Automatically check for updates"