#!/bin/bash
#090108 Daniel Holm's Atheros AR242x install-script. V.1

#Totally remove the restricted common module to avoid crashed with the (soon) newly installed module.
#Tar bort restricted common modulen så att den inte ska krocka med den modulen som ska installeras.
sudo apt-get remove --purge linux-restricted-modules-common 
echo Removed.
#Downloading the new module.
#Laddar ner den nya modulen.
echo Begining download:
wget -c http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2
echo Downloaded.
#Unpacking
#Upppackning
tar xvf compat-wireless-2.6.tar.bz2
echo unpacked.
cd compat-wireless-2.6.tar/
#Updating package list
#Uppdaterar paket listan
sudo apt-get update
#Installing needed package for compiling and installing the module.
#Installerar nödvändiga paket för compilering och installation av modulen.
sudo apt-get install build-essential
#Staring the compiling
#Startar compilering
make
#Installing module.
#Installerar modulen.
sudo make install
#Unloadint the ath5k module.
#Laddar ur ath5k modulen.
sudo make unload
#Reload it
#Laddar om den.
sudo make load
#Show a reboot message
#Visa ett omstartsmeddelande
zenity --info --text "Press Ok when you are ready to reboot."
sudo reboot

exit 0
