Ubuntu 10.04 kohandusskript

Allikas: Pingviini viki
Redaktsioon seisuga 17. mai 2010, kell 09:47 kasutajalt Tramm (arutelu | kaastöö) (Vaikimisi sisselülitatud ainult otseselt eestindamisega seotud asjad)

Kohanduskript paigaldab Ubuntu 10.04 Lucid Lynx'ile opsüsteemis vaikimisi puuduvad multimeediafailide mängimiseks vajalikud koodekid, Java- ja Flash-plugina, Eesti ID-kaardi toe (nii 32- kui 64-bitise Ubuntu jaoks), ning rea programme, nt GIMP, VLC, Thunderbird jt.

Kasutamine

Skript on mõeldud ühekordseks kasutamiseks, kuid seda võib ka korduvalt kasutada, nt nende programmide paigaldamiseks mida te esimesel korral ei valinud, tingimusel et jätate märgistamata need kontrollkastid mida olete varem kasutanud. Esialgse versiooni autori (Alin Andrei) selgituse kohaselt töötab skript veatult ainult kõvakettale paigaldatud Ubuntu korral.

Sammud

  • Kõigepealt tuleks paigaldada süsteemi uuendused. Seisuga 07.05.10 oli neid 45. Kuu aega pärast Ubuntu 10.04 ilmumist on neid arvatavasti üle saja.
  • Laadida alla skript ja see kävitada.

Vaata täpsemalt

Kohandusskripti kood

#!/bin/bash
#     Script which should help users install / tweak some stuff immediately 
#     after installing Ubuntu 10.04 Lucid Lynx 32bit and 64bit.
#
#                           version 0.4.2.2
#
#     The script comes with no warranty. The author is not responsible if
#     your system breaks.
#
##   
##    Copyright (C) 2010 Alin Andrei, http://www.webupd8.org
##
##    Muutnud Tramm 17.05.10 http://viki.pingviin.org/Kasutaja:Tramm
##    Muutnud A.Mägi 06.05.10
##    Eemaldatud lähtekoodi ja backports varamud ning arendusvahendid, 
##    lisatud ppa:rvm/smplayer uusima SMplayeri ja MPlayeri jaoks 
##    lisatud Eesti ID-kaardi tugi (32- ja 64-bit), programmid gThumb ja avant-window-navigator koos lisadega, 
##    thunderbirdi eesti keele tugi
##
##    Eesti ID-kaardi tugi Märt Põder. 
##    Enam pole vaja käsitsi Firefoxile sertifikaate lisada ja turvamoodulit näidata 
##
##    This program is free software: you can redistribute it and/or modify
##    it under the terms of the GNU General Public License as published by
##    the Free Software Foundation, either version 3 of the License, or
##    (at your option) any later version.
##
##    This program is distributed in the hope that it will be useful,
##    but WITHOUT ANY WARRANTY; without even the implied warranty of
##    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##    GNU General Public License for more details.
##
##    You should have received a copy of the GNU General Public License
##    along with this program. If not, see <http://www.gnu.org/licenses/>.
#####################
#Credits: 
#andreineculau.com for original Pidgin icons, Mongi Gazelle for the sharp fonts script.
#based on the idea of: http://czytelnia.ubuntu.pl/index.php/2009/11/03/skrypt-ulatwiajacy-konfiguracje-ubuntu-9-10-karmic-koala/, but Ubuntu Start is a completely re-written script with lots of new features.
#####################
#Options explainations:
#Move window buttons to the right (Karmic style) - will move the metacity window buttons to the right side, in the following order: Minimize, Maximize, Close
#Change Update Manager behavior to the one in Jaunty - Ubuntu 9.04 (and newer) introduced a change to the handling of package updates, launching update-manager directly instead of displaying a notification icon in the GNOME panel. Users will still be notified of security updates on a daily basis, but for updates that are not security-related, users will only be prompted once a week. This tweak makes the update-manager not pop-up, but always show the updates in the notification area.
#Remove mounted drive icons from desktop - removes ntfs and usb drives from the desktop; usually when mounting a drive it shows up on the desktop
#Disable the GDM login sound - all the sounds in Ubuntu can be turned off from a GUI except this one. This is the sound produced when the GDM login screen loads.
#Enable the icons in menus and buttons - the icons in menus and buttons were removed in Gnome 2.28 (starting with Ubuntu Karmic). However, up until Lucid, users were able to enable these from the Appearence dialog preferences. This is no longer possible so use this tweak instead.
#Disable the GDM login user list - in Lucid, the users are displayed in the GDM login screen (which IMO is a security concern). This fix will make no user show up in this list, and for logging in you must enter your username and password manually.
#Change Gnome Calendar first day of the week from Sunday to Monday tweak - Gnome Calendar comes with Sunday as the first day of the week. This tweak fixes this for non-US citizens.
#Remove the ubuntu-docs package (frees up 252MB): removed the ubuntu-docs package to free up 252 MB of disk space.
#Install and configure sharp fonts: info about this feature, here: http://www.webupd8.org/2009/09/ubuntu-debian-script-to-install-sharp.html
#Fix 'apt-get update' delay for Google Chrome repository - when downloading Google Chrome .deb, it automatically adds the Google Chrome repository. This repository has a known issue which cause "sudo apt-get update" to take a very long time to complete. This tweak fixes this issue.
#Add additional repositories (GetDeb, Medibuntu etc.) - Adds the following repositories: Getdeb, Medibuntu, Ubuntu universe and multiverse and lucid partner.
########
#The second dialog - install packages.
 
 
TRUETYPEPATH="/usr/share/fonts/truetype/"
ROOT_UID=0
 
#check if the user is running lucid 32 or 64bit
if [ "lucid" = `lsb_release -cs` ]; then
   if [ "i686" = `uname -m` ]; then
      echo using Ubuntu 10.04 Lucid Lynx - ok
   elif [ "x86_64" = `uname -m` ]; then
      echo using Ubuntu 10.04 Lucid Lynx - ok
   else
       /usr/bin/zenity --warning --title="Error" --text="Error: You are not using Ubuntu 10.04 Lucid Lynx 32bit or 64bit"
       echo You are not using Ubuntu 10.04 Lucid Lynx 32bit or 64bit, exiting
       exit
   fi
else
       /usr/bin/zenity --warning --title="Error" --text="Error: You are not using Ubuntu 10.04 Lucid Lynx"
       echo You are not using Ubuntu 10.04 Lucid Lynx, exiting
       exit
fi
 
# needs to be run with sudo
if [ "$UID" -ne "$ROOT_UID" ];
   then
   /usr/bin/zenity --warning --title="Error" --text="You must have sudo privileges to run this script. Try: sudo ./ubuntu-10.04-script"
   echo "Exiting ... please run the script with sudo (eg: sudo ./ubuntu-10.04-script)"
   exit
fi
 
# check if there are applications running which can interfere with the script
sleep 1
if ps -U root -u root u | grep "synaptic" | grep -v grep > /dev/null;
       then 
       echo "Installation won't work. Please close Synaptic first then try again.";
       /usr/bin/zenity --warning --title="Error" --text="Installation won't work. Close Synaptic first then try again."
       exit
elif ps -U root -u root u | grep "update-manager" | grep -v grep > /dev/null;
       then 
       echo "Installation won't work. Please close Update Manager first then try again.";
       /usr/bin/zenity --warning --title="Error" --text="Installation won't work. Close update-manager first then try again."
       exit
elif ps -U root -u root u | grep "software-center" | grep -v grep > /dev/null;
       then 
       echo "Installation won't work. Please close Software Center first then try again.";
       /usr/bin/zenity --warning --title="Error" --text="Installation won't work. Close update-manager first then try again."
       exit
elif ps -U root -u root u | grep "apt-get" | grep -v grep > /dev/null;
       then echo "Installation won't work. Please wait for apt-get to finish running, or terminate the process, then try again.";
       /usr/bin/zenity --warning --title="Error" --text="Installation won't work. Wait for apt-get to finish running, or exit it, then try again."
       exit
elif ps -U root -u root u | grep "dpkg" | grep -v grep > /dev/null;
       then 
       echo "Installation won't work. Wait for dpkg to finish running, or exit it, then try again.";
       /usr/bin/zenity --warning --title="Error" --text="Installation won't work. Wait for dpkg to finish running, or exit it, then try again."
       exit
fi
 
#check if the user has an active internet connection
function testConnection() 
{
testconnection=`wget www.google.com -O /tmp/testinternet &>/dev/null 2>&1`
if [ $? != 0 ]; then
sleep 5
echo  "You are not connected to the Internet. Please check your Internet connection and try again."
/usr/bin/zenity --info --text="<b>Error:</b> You are not connected to the Internet but selected an option which requires an Internet Connection. Please fix your Internet connection and try again."
testConnection
else
echo Internet connection - ok
fi
}
 
 
 
#running gconf-tool2 with "sudo" fails to set the options for the current user so this tweak makes it possible to run sudo for gconf-tool2 and change the setting for the current user, not the root user
ON_USER=$(cat /etc/passwd | grep :1000: | cut -d ':' -f 1)
export $(grep -v "^#" ~/.dbus/session-bus/`cat /var/lib/dbus/machine-id`-0)
if sudo -u $ON_USER test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
       eval `sudo -u $ON_USER dbus-launch --sh-syntax --exit-with-session`
fi
echo $ON_USER
echo $DBUS_SESSION
echo $DBUS_SESSION_BUS_ADDRESS
echo $DBUS_SESSION_BUS_WINDOWID
echo $DBUS_SESSION_BUS_PID
 
#gui 1
choicess=`/usr/bin/zenity --title="Step 1: Tweaks, fixes and repositories" --width=500 --height=400 \
                          --text="Important: \n\nIf you do not select the 'Add additional repositories' option, you will not be able \nto install some packages in Step 2. \n\nAlso, for some settings take place, you'll have to log out and then log back in \n(but only do this after both Step 1 and Step 2 have been completed!).\n\nSelect:" \
                         --list --column="Selected" --column="Tweak" \
                         --checklist FALSE "Move window buttons to the right (Karmic style)" FALSE "Change Update Manager behavior to the one in Jaunty" FALSE "Remove mounted drive icons from desktop" FALSE "Disable the GDM login sound" FALSE "Enable the icons in menus and buttons" FALSE "Disable the GDM login user list" TRUE "Change Gnome Calendar first day of the week from Sunday to Monday" FALSE "Remove the ubuntu-docs package (frees up 252MB)" FALSE "Install and configure sharp fonts" FALSE "Fix 'apt-get update' delay for Google repository" FALSE "Automatically mount NTFS drives on startup" TRUE "Add additional repositories (GetDeb, Medibuntu etc.)"`
 
 
if [ $? -eq 0 ];
then
        IFS="|"
        for choicee in $choicess
        do
               if [ "$choicee" = "Move window buttons to the right (Karmic style)" ];
                     then 
                     sudo -u $ON_USER "DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS gconftool-2 --type string --set /apps/metacity/general/button_layout ":minimize,maximize,close"
               elif [ "$choicee" = "Change Update Manager behavior to the one in Jaunty" ];
                     then
                     sudo -u $ON_USER "DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS gconftool -s --type bool /apps/update-notifier/auto_launch false
              elif [ "$choicee" = "Remove mounted drive icons from desktop" ];
                     then
                     sudo -u $ON_USER "DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS gconftool -s --type bool /apps/nautilus/desktop/volumes_visible false
               elif [ "$choicee" = "Disable the GDM login sound" ];
                     then
                     sudo -u gdm gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false
                     sudo -u $ON_USER "DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false
              elif [ "$choicee" = "Enable the icons in menus and buttons" ];
                     then
                     sudo -u $ON_USER "DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS gconftool-2 --set /desktop/gnome/interface/buttons_have_icons --type bool true
                     sudo -u $ON_USER "DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool true
              elif [ "$choicee" = "Disable the GDM login user list" ];
                     then
                     sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true
              elif [ "$choicee" = "Change Gnome Calendar first day of the week from Sunday to Monday" ];
                     then
                     timee=$(cat /etc/default/locale | grep "LC_TIME")
                     if [ ! $timee ]; then
                     timeee="et_EE.UTF-8"
                     echo LC_TIME=\"$timeee.UTF-8\" | sudo tee -a /etc/default/locale > /dev/null
					 sed -r -i -e "s/weekday 1/weekday 2/" /usr/share/i18n/locales/et_EE
					 locale-gen
                     else
                     echo "You already have custom values for LC_TIME, skipping this tweak"
                     fi
              elif [ "$choicee" = "Remove the ubuntu-docs package (frees up 252MB)" ];
                     then
                     sudo apt-get remove -y --force-yes ubuntu-docs
 
              elif [ "$choicee" = "Install and configure sharp fonts" ];
                     then
                     testConnection
                     /usr/bin/zenity --info --text="You selected to install Sharp Fonts. This may take a few minutes depending on your connection speed. \n\nClick OK to continue!"
                     cd /tmp
                     echo "Installing Sharpfonts. This may take a few minutes depending on connection speed..."
                     # download and install the cabextract tool
                     echo "Installing the cabextract tool..."
                     sudo apt-get install -y --force-yes cabextract
                     # Download all needed fonts
                     wget http://sharpfonts.com/fonts/andale32.exe
                     wget http://sharpfonts.com/fonts/arial32.exe
                     wget http://sharpfonts.com/fonts/arialb32.exe
                     wget http://sharpfonts.com/fonts/comic32.exe
                     wget http://sharpfonts.com/fonts/courie32.exe
                     wget http://sharpfonts.com/fonts/georgi32.exe
                     wget http://sharpfonts.com/fonts/impact32.exe
                     wget http://sharpfonts.com/fonts/tahoma32.exe
                     wget http://sharpfonts.com/fonts/times32.exe
                     wget http://sharpfonts.com/fonts/trebuc32.exe
                     wget http://sharpfonts.com/fonts/verdan32.exe
                     wget http://sharpfonts.com/fonts/webdin32.exe
                     # create the needed directory if it is not existing
                     if [ ! -d $TRUETYPEPATH ]; then
                     mkdir -p $TRUETYPEPATH
                     fi
                     # Extract all fonts to the truetype directory
                     cabextract -d /usr/share/fonts/truetype/ andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe georgi32.exe impact32.exe tahoma32.exe times32.exe trebuc32.exe verdan32.exe webdin32.exe
                     # Download the xml files and extract the configuration files into /etc/fonts/
                     wget http://sharpfonts.com/fontconfig.tbz
                     tar xvjpf fontconfig.tbz -C /etc/fonts/
                     rm -r /tmp/*.exe 
                     rm /tmp/fontconfig.tbz
 
					 # A. Mägi lisndus aadressilt http://ubuntu.pingviin.org/1004kohandamine.html
					 sudo apt-get install ttf-mscorefonts-installer
 
                     echo "Sharp fonts installation finished... Please remember to logout and login again"
              elif [ "$choicee" = "Fix 'apt-get update' delay for Google repository" ];
                     then
                     echo "Acquire::http::Pipeline-Depth "0";" | sudo tee -a /etc/apt/apt.conf.d/90localsettings > /dev/null
              elif [ "$choicee" = "Automatically mount NTFS drives on startup" ];
                     then
                         sudo apt-get -y --force-yes install ntfs-3g
 
				if [ $(cat /etc/fstab | grep '^[^#].*ntfs-3g' > /tmp/checkntfs-3g.txt; cat /tmp/checkntfs-3g.txt | wc -l) -gt 0 ];
				then
				    echo You already have ntfs-3g enabled
				else
					NTFSS=$(sudo blkid -c /dev/null -t TYPE=ntfs | cut -d ':' -f 1 > /tmp/checkntfs.txt)
					while read curline; do
					      echo $curline #debugging
					      dirr=$(echo $curline | cut -c 6- | sed -e 's/\///g')
					      sudo mkdir /media/$dirr
					      NTFSUUID=$(sudo blkid -c /dev/null -t TYPE=ntfs | grep $curline | cut -d '"' -f 4)
					      echo $NTFSUUID #debugging
					      eval "echo UUID=$NTFSUUID	/media/$dirr ntfs-3g users  0  0" | sudo tee -a /etc/fstab > /dev/null
					done < /tmp/checkntfs.txt
					echo Done!
				fi
                         rm /tmp/checkntfs.txt /tmp/checkntfs-3g.txt
              elif [ "$choicee" = "Add additional repositories (GetDeb, Medibuntu etc.)" ];
                   then
                   testConnection
                   sudo rm /etc/apt/sources.list_backup
                   sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
                   /usr/bin/zenity --info --text="Please wait while testing main Medibuntu server and mirrons (it should take about ~20 seconds). Once this is over, a new dialog will pop-up with Step 2: package installation. \n\nClick OK to continue!"
                   testmedibuntu=`wget --tries=1 --timeout=10 http://packages.medibuntu.org/ -O /tmp/testmedibuntumain; cat /tmp/testmedibuntumain | wc -l`
                   testmedibuntuu=`wget --tries=1 --timeout=10 http://mirrors.ucr.ac.cr/medibuntu/ -O /tmp/testmedibuntuu; cat /tmp/testmedibuntuu | wc -l`
                   testmedibuntuuu=`wget --tries=1 --timeout=10 http://mirror.oscc.org.my/medibuntu/ -O /tmp/testmedibuntuuu; cat /tmp/testmedibuntuuu | wc -l`
                   testmedibuntuuuu=`wget --tries=1 --timeout=10 ftp://ftp.leg.uct.ac.za/pub/linux/medibuntu/ -O /tmp/testmedibuntuuuu; cat /tmp/testmedibuntuuuu | wc -l`
                   #sleep 15
                   if [ $testmedibuntu -gt 0 ]; then
                         mediserv="http://packages.medibuntu.org"
                         medibuntuserver="deb http://packages.medibuntu.org/ lucid free non-free"
                         medibuntuSOURCEserver="deb-src http://packages.medibuntu.org/ lucid free non-free"
                   elif [ $testmedibuntuu -gt 0 ]; then
                         mediserv="http://mirrors.ucr.ac.cr/medibuntu"
                         medibuntuserver="deb http://mirrors.ucr.ac.cr/medibuntu/ lucid free non-free"
                         medibuntuSOURCEserver="deb-src http://mirrors.ucr.ac.cr/medibuntu/ lucid free non-free"
                   elif [ $testmedibuntuuu -gt 0 ]; then
                         mediserv="http://mirror.oscc.org.my/medibuntu"
                         medibuntuserver="deb http://mirror.oscc.org.my/medibuntu/ lucid free non-free"
                         medibuntuSOURCEserver="deb-src http://mirror.oscc.org.my/medibuntu/ lucid free non-free"
                   elif [ $testmedibuntuuuu -gt 0 ]; then
                         mediserv="ftp://ftp.leg.uct.ac.za/pub/linux/medibuntu"
                         medibuntuserver="deb ftp://ftp.leg.uct.ac.za/pub/linux/medibuntu/ lucid free non-free"
                         medibuntuSOURCEserver="deb-src ftp://ftp.leg.uct.ac.za/pub/linux/medibuntu/ lucid free non-free"
                   fi
                   rm /tmp/testmedibuntumain /tmp/testmedibuntuu /tmp/testmedibuntuuu /tmp/testmedibuntuuuu
 
 
                   cat /etc/apt/sources.list_backup | sed -e '/.*main.*restricted.*/d' > /etc/apt/sources.list; sleep 1  #delete the ubuntu default repositories so we don't get double repos
                   sleep 1 | cp /etc/apt/sources.list /etc/apt/sources.list_medibuntu; cat /etc/apt/sources.list_medibuntu | sed -e '/.*medibuntu.*lucid free non-free/d' > /etc/apt/sources.list; sleep 1 
                   sleep 1; cp /etc/apt/sources.list /etc/apt/sources.list_empty; cat /etc/apt/sources.list_empty | sed '/^$/d' > /etc/apt/sources.list; sleep 1; rm /etc/apt/sources.list_empty #remove empty lines in sources.list
                   ARRAY=( 'deb http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse' 'deb http://archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse' 'deb http://archive.canonical.com/ubuntu lucid partner' 'deb http://security.ubuntu.com/ubuntu lucid-security main restricted universe multiverse'  $medibuntuserver 'deb http://archive.getdeb.net/ubuntu lucid-getdeb apps' 'deb http://ppa.launchpad.net/boamaod/ubuntu-idkaart/ubuntu lucid main' )
                  ELEMENTS=${#ARRAY[@]}
 
                  for (( i=0;i<$ELEMENTS;i++));
                      do 
                         repos=`cat /etc/apt/sources.list | grep "${ARRAY[${i}]}"`
                         if [ $? -eq 0 ];
                         then
                              echo "${ARRAY[${i}]}" already exists, skipping
                         else
                              echo "${ARRAY[${i}]}" | sudo tee -a /etc/apt/sources.list > /dev/null # add all the repositories which are not in the sources.list file already
                         fi
                      done
                   testConnection
                   # lisa smplayer varamu, mida varem kindlasti ei olnud (sealt SMPplayeri ja MPlayeri uusimad versioonid)
		   # sudo add-apt-repository ppa:nilarimogard/webupd8, ei sisalda enam VLC-pleierit
		   sudo add-apt-repository ppa:rvm/smplayer
		   wget -q -O- $mediserv/medibuntu-key.gpg | sudo apt-key add -
                   #sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
                   wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
 
                   sudo apt-get update
               fi
        done
        IFS=""
        /usr/bin/zenity --info --text="Done! We will now proceed to Step 2."
else
        echo cancel selected
fi
 
#gui 2
choices=`/usr/bin/zenity --title="Step 2: Install packages" --width=520 --height=400 \
                         --text="Choose packages to install:" \
                         --list --column="Selected" --column="Package" --column="Description" \
                         --checklist FALSE "GIMP" "Image Editor" FALSE "Pidgin (including original smileys)" "Multi-protocol instant messaging client" FALSE "WINE" "Run Windows applications in Linux" FALSE "Chromium-browser" "Open source browser" FALSE "Gnome-Do" "Quick launcher" FALSE "Guake" "Quake-like terminal emulator" FALSE "VLC" "Media player" FALSE "SMPlayer" "Media player (MPlayer front-end)" FALSE "Thunderbird" "Email client" TRUE "Codecs and extras" "Codecs (multimedia, java, flash), additional archives support, DVD support and fonts" FALSE "Ubuntu-Tweak" "Tweak Ubuntu and add lots of additional repositories (PPAs)" FALSE "Dropbox" "Cross-platform cloud sync application" FALSE "Deluge" "BitTorrent client" FALSE "CCSM" "CompizConfig Settings Manager" FALSE "Skype" "VoIP chat application" FALSE "Google Chrome" "Google's browser" TRUE "Estonian ID-card support" "Identification and signing" FALSE "Avant-window-navigator" "Dock and Launcher" FALSE "gthumb" "Photo manager"`
 
if [ $? -eq 0 ]
then
        IFS="|"
        testConnection
        /usr/bin/zenity --info --text="The package download and installation will begin. Please do not restart your computer until the script is done. \n\nClick OK to start!"
        for choice in $choices
        do
              if [ "$choice" = "Codecs and extras" ];
                   then
                       if [ "i686" = `uname -m` ]; then
                           sudo echo sun-java6-jre shared/accepted-sun-dlj-v1-1 select true | sudo /usr/bin/debconf-set-selections
sudo apt-get install --yes sun-java6-plugin
			   # eemaldatud ttf-mscorefonts-installer, mis vahel skripti seiskumist põhjustab
                           sudo apt-get -y --force-yes install gstreamer0.10-ffmpeg gstreamer0.10-pitfdll gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libdvdnav4 libdvdread4 libdvdcss2 libxine1-ffmpeg ffmpeg w32codecs flashplugin-nonfree sun-java6-fonts rar unrar p7zip-full p7zip-rar unace unp ttf-liberation
                       else
                           sudo echo sun-java6-jre shared/accepted-sun-dlj-v1-1 select true | sudo /usr/bin/debconf-set-selections
sudo apt-get install --yes sun-java6-plugin
                           sudo apt-get -y --force-yes install gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libdvdnav4 libdvdread4 libdvdcss2 libxine1-ffmpeg ffmpeg w64codecs sun-java6-fonts rar unrar p7zip-full p7zip-rar unace unp ttf-liberation
                           cd /tmp
                           wget http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz
                           tar xzf libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz
                           sudo mkdir /usr/lib/flashplugin-nonfree/
                           sudo mv libflashplayer.so /usr/lib/flashplugin-nonfree/
                           sudo ln -s /usr/lib/flashplugin-nonfree/libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so
                           rm libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz
                      fi
 
 
             elif [ "$choice" = "Google Chrome" ];
                   then
                        cd /tmp
                        if [ "i686" = `uname -m` ]; then
                           wget http://dl.google.com/linux/direct/google-chrome-unstable_current_i386.deb
                           sudo dpkg -i --force-all google-chrome-unstable_current_i386.deb
                           sudo apt-get install -f -y
                           rm google-chrome-unstable_current_i386.deb
                        else
                           wget http://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
                           sudo dpkg -i --force-all google-chrome-unstable_current_amd64.deb
                           sudo apt-get install -f -y
                           rm google-chrome-unstable_current_amd64.deb
                         fi
             elif [ "$choice" = "Skype" ];
                   then
                        cd /tmp
                        if [ "i686" = `uname -m` ]; then
                           wget http://download.skype.com/linux/skype-ubuntu-intrepid_2.1.0.81-1_i386.deb
                           sudo dpkg -i --force-all skype-ubuntu-intrepid_2.1.0.81-1_i386.deb
                           sudo apt-get install -f -y
                           rm skype-ubuntu-intrepid_2.1.0.81-1_i386.deb
                        else
                           wget http://download.skype.com/linux/skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
                           sudo dpkg -i --force-all skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
                           sudo apt-get install -f -y
                           rm skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
                         fi
             elif [ "$choice" = "Pidgin (including original smileys)" ];
                   then
                        sudo apt-get -y --force-yes install pidgin
                        rm ~/.purple/prefs_backup.xml #in case the user runs the script twice
                        cd ~/.purple/smileys/
                        wget http://files.andreineculau.com/projects/pidgin/original-smileys/pidgin-original-1.9.tgz
                        tar -xvf pidgin-original-1.9.tgz
                        rm pidgin-original-1.9.tgz
                        cp ~/.purple/prefs.xml ~/.purple/prefs_backup.xml
                        cat ~/.purple/prefs_backup.xml | sed -e '/smileys/,/theme/s/Default/Original Smileys 1\.9/g' > ~/.purple/prefs.xml
                        chown -R $ON_USER ~/.purple/smileys/
                        chown -R $ON_USER ~/.purple/prefs_backup.xml
 
		elif [ "$choice" = "Estonian ID-card support" ];
                   then
 
				# https://launchpad.net/~boamaod/+archive/ubuntu-idkaart
				# http://viki.pingviin.org/ID-kaardi_automaatne_seadistamine
				sudo apt-get install ubuntu-idkaart-allikad                   
				sudo apt-get install ubuntu-idkaart-paigaldus
 
             elif [ "$choice" = "Avant-window-navigator" ];
                   then
			# paigalda avant-window-navigator koos lisadega
			sudo apt-get -y --force-yes install avant-window-navigator awn-applets-c-extras awn-applets-python-extras
	     elif [ "$choice" = "Thunderbird" ];
                   then
			# paigalda thunderbird koos eesti keele pakiga
			sudo apt-get -y --force-yes install thunderbird thunderbird-locale-et
             elif [ "$choice" = "Dropbox" ];
                   then
                         reposs=`cat /etc/apt/sources.list | grep "dropbox"`
                         if [ $? -eq 0 ];
                         then
                              echo Dropbox repository already exists, skipping repository add
                              sudo apt-get update
                              sudo apt-get -y --force-yes install nautilus-dropbox
                         else
                              echo "deb http://linux.dropbox.com/ubuntu karmic main" | sudo tee -a /etc/apt/sources.list > /dev/null
                              sudo gpg --keyserver pgp.mit.edu --recv-keys 3565780E
                              sudo apt-get update
                              sudo apt-get -y --force-yes install nautilus-dropbox
                         fi
              elif [ "$choice" = "CCSM" ];
                   then
                        sudo apt-get -y --force-yes install compizconfig-settings-manager
 
              else
                        choiceLOW=`echo $choice | tr '[:upper:]' '[:lower:]'`
                        sudo apt-get -y --force-yes install $choiceLOW
            fi
       done
#cleaning up
       sudo apt-get clean
       sudo apt-get autoclean
 
	   # http://ubuntu.pingviin.org/1004kohandamine.html
	   killall gnome-panel
#notices
       if [[ "$choicee" = "Change Gnome Calendar first day of the week from Sunday to Monday" || "$choicee" = "Install and configure sharp fonts" ]]; then
       /usr/bin/zenity --info --text="Done! Please log out and then log back in (this is required for some of the tweaks you've selected). \n\nFor bugs and suggestions, please visit: http://www.webupd8.org"
       else
       /usr/bin/zenity --info --text="Done! All the selected packages have been installed. \n\nFor bugs and suggestions, please visit: http://www.webupd8.org"
       IFS=""
       fi
       rm /tmp/testinternet
else
       rm /tmp/testinternet
       echo cancel selected
       exit
fi
 
 
#changelog
 
#
 
#0.4.2.2
#removed devtools package from development packages options due to this package requesting user interaction with the terminal
#fix GPG keys import for medibuntu and getdeb
 
#0.4.2.1
#fixed Pidgin installation not working
#added one more Medibuntu mirror
#clean empty lines in sources.list
#remove 15s sleep for when testing medibuntu mirrors
 
#v0.4.2
#added Change Gnome Calendar first day of the week from Sunday to Monday tweak.
#check if the user selects an options which requires he logs out and then logs back in and if so, notify him.
#lots of fixes, especially to automatically mount NTFS drives feature which now add drives by UUID instead of name
#clean up when done
#internet connection check
#fix double repositories in some cases
#added 2 medibuntu mirrors in case medibuntu main server is down, will check which one is working and add it to sources.list
 
#v0.4.1
#added smplayer
#integrated Mongi Gazelle's sharp fonts script: http://www.webupd8.org/2009/09/ubuntu-debian-script-to-install-sharp.html
#also from Mongi Gazelle's script: incorporated the synaptic, apt-get, etc. check and if those processes are running, close the script and ask the user to close them before running the script
#added guake
#included original protocol smileys with Pidgin installation (from http://files.andreineculau.com/projects/pidgin/original-smileys/)
#install deluge
#automatically mount NTFS drives on startup
 
#v0.4
#added Skype 32bit and 64bit download & install
#sudo check: the script exists if it is not run as sudo
#install compizconfig-settings-manager
#show dialog when going from step 1 to step 2 and show "Done" dialog when all the packages in step 2 have been installed
#fixed 'disable GDM login sound'
 
#v0.3
#added gnome-do
#Remove drive icons from desktop gconf tweak
#fix Google Chrome repository slowness for "apt-get update"
#some other fixes
 
#v0.2:
#added autoaccept for the java license when installing the java plugin
#added dropbox repository and installation
#added disable GDM login user list
#added build-essential, subversion, git, etc