Files
tareo-scripts/clients/initialsetup.sh

50 lines
1.5 KiB
Bash
Raw Normal View History

#!/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"
2016-02-26 02:22:04 +01:00
echo 'Acquire::http { Proxy "http://mit.tareo-tz.org: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"
2016-02-26 02:22:04 +01:00
apt-get -y install synaptic filezilla libreoffice
apt-get -y purge gnumeric* abiword*
# 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"