|
|
|
|
|
|
|
|
#!/bin/sh |
|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Installing required packages" |
|
|
echo "Installing required packages" |
|
|
|
|
|
echo "################################################" |
|
|
apt-get --assume-yes install \ |
|
|
apt-get --assume-yes install \ |
|
|
build-essential \ |
|
|
build-essential \ |
|
|
linux-headers-amd64 \ |
|
|
linux-headers-amd64 \ |
|
|
|
|
|
|
|
|
unbound \ |
|
|
unbound \ |
|
|
vim-tiny |
|
|
vim-tiny |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Removing unused packages" |
|
|
echo "Removing unused packages" |
|
|
|
|
|
echo "################################################" |
|
|
apt-get --assume-yes remove --purge nano |
|
|
apt-get --assume-yes remove --purge nano |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Mounting VirtualBox VM guest additions CD..." |
|
|
echo "Mounting VirtualBox VM guest additions CD..." |
|
|
|
|
|
echo "################################################" |
|
|
mount /dev/cdrom /mnt |
|
|
mount /dev/cdrom /mnt |
|
|
|
|
|
echo "################################################" |
|
|
echo "Compiling VM additions..." |
|
|
echo "Compiling VM additions..." |
|
|
for i in `cd /mnt && ./VBoxLinuxAdditions.run`; do echo -n "."; done |
|
|
|
|
|
echo " Done" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
|
|
|
/mnt/VBoxLinuxAdditions.run |
|
|
|
|
|
echo "################################################" |
|
|
echo "Unmounting CD..." |
|
|
echo "Unmounting CD..." |
|
|
cd - |
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
umount /mnt |
|
|
umount /mnt |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Copying static configs" |
|
|
echo "Copying static configs" |
|
|
cd static && rsync -av . / |
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
|
|
|
rsync -av static/ / |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Disabling IPv6" |
|
|
echo "Disabling IPv6" |
|
|
|
|
|
echo "################################################" |
|
|
echo net.ipv6.conf.all.disable_ipv6=1 >> /etc/sysctl.conf |
|
|
echo net.ipv6.conf.all.disable_ipv6=1 >> /etc/sysctl.conf |
|
|
echo net.ipv6.conf.default.disable_ipv6=1 >> /etc/sysctl.conf |
|
|
echo net.ipv6.conf.default.disable_ipv6=1 >> /etc/sysctl.conf |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
|
|
|
echo "Force DNS servers in DHCP client" |
|
|
|
|
|
echo "################################################" |
|
|
|
|
|
echo "supersede domain-name-servers 127.0.0.1;" >> /etc/dhcp/dhhclient.conf |
|
|
|
|
|
|
|
|
for INSTUSER in `cd /home && ls -d *` |
|
|
for INSTUSER in `cd /home && ls -d *` |
|
|
do |
|
|
do |
|
|
|
|
|
echo "################################################" |
|
|
echo "Installing non-root setup for $INSTUSER" |
|
|
echo "Installing non-root setup for $INSTUSER" |
|
|
|
|
|
echo "################################################" |
|
|
cp -R user/* /home/${INSTUSER}/ |
|
|
cp -R user/* /home/${INSTUSER}/ |
|
|
chown -R ${INSTUSER}:${INSTUSER} /home/${INSTUSER}/ |
|
|
chown -R ${INSTUSER}:${INSTUSER} /home/${INSTUSER}/ |
|
|
|
|
|
echo "################################################" |
|
|
echo "Disable bash_history for user ${INSTUSER}" |
|
|
echo "Disable bash_history for user ${INSTUSER}" |
|
|
|
|
|
echo "################################################" |
|
|
rm -f /home/${INSTUSER}/.bash_history |
|
|
rm -f /home/${INSTUSER}/.bash_history |
|
|
ln -s /dev/null /home/${INSTUSER}/.bash_history |
|
|
ln -s /dev/null /home/${INSTUSER}/.bash_history |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Disable bash_history for root" |
|
|
echo "Disable bash_history for root" |
|
|
|
|
|
echo "################################################" |
|
|
rm -f /root/.bash_history |
|
|
rm -f /root/.bash_history |
|
|
ln -s /dev/null /root/.bash_history |
|
|
ln -s /dev/null /root/.bash_history |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Cleaning apt/pkg" |
|
|
echo "Cleaning apt/pkg" |
|
|
|
|
|
echo "################################################" |
|
|
apt-get clean |
|
|
apt-get clean |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Cleaning syslog" |
|
|
echo "Cleaning syslog" |
|
|
|
|
|
echo "################################################" |
|
|
/etc/init.d/rsyslog stop |
|
|
/etc/init.d/rsyslog stop |
|
|
find /var/log -type f -print0 | xargs -0 rm |
|
|
find /var/log -type f -print0 | xargs -0 rm |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Removing installer script, git package and dependencies" |
|
|
echo "Removing installer script, git package and dependencies" |
|
|
|
|
|
echo "################################################" |
|
|
cd .. |
|
|
cd .. |
|
|
rm -rf torvm |
|
|
rm -rf torvm |
|
|
apt-get --assume-yes remove --purge git |
|
|
apt-get --assume-yes remove --purge git |
|
|
apt-get --assume-yes autoremove --purge |
|
|
apt-get --assume-yes autoremove --purge |
|
|
|
|
|
|
|
|
|
|
|
echo "################################################" |
|
|
echo "Setup complete, please reboot to make it active" |
|
|
echo "Setup complete, please reboot to make it active" |
|
|
|
|
|
echo "################################################" |