Files
tareo-scripts/clients/initialsetup.sh
2015-07-24 14:23:16 +03:00

49 lines
1.4 KiB
Bash

#!/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 (only in Dual boot)
#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.10.10: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
# Default software
echo "Installing default software"
apt-get -y install synaptic filezilla
# 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"