#!/bin/bash
# A small bash script for installing CrunchBang Linux 8.10.02
# Run as root (sudo ./crunchbang-installer-8.10.02.sh)
#------------------------------------------------------------------------

#Add CrunchBang Repository
#=========================
wget http://crunchbang.net/packages-8.10.xx/crunchbang.list -O /etc/apt/sources.list.d/crunchbang.list
wget -q http://crunchbang.net/crunchbang.key -O- | apt-key add - && apt-get update

#Add Medibuntu Repository
#========================
wget http://www.medibuntu.org/sources.list.d/intrepid.list -O /etc/apt/sources.list.d/medibuntu.list
apt-get update && apt-get install medibuntu-keyring && apt-get update

#Install main meta-package
#=========================
apt-get install -y --install-recommends crunchbang-desktop

#Perform a reinstall to ensure all data/settings stick
#===========================================================
apt-get install --reinstall crunchbang-desktop

#Copy new BASH profile to user account
#=====================================
cp -f /etc/skel/.profile ~/.profile
chown $SUDO_USER:$SUDO_USER ~/.profile

#Remove all downloaded packages
#==============================
apt-get clean

#Exit with message
#=================
echo "Installation complete. Thank you for installing CrunchBang Linux."
echo "You might want to consider rebooting your system."
echo ""
echo "Issue the following command to reboot:"
echo ""
echo "    \$ sudo reboot now"
echo ""

exit 0
