Ubumatic - Ubuntu (11.04/10.10/10.04) temel faaliyetlerini basitçe yapılandırın

Başlatan decent, 03 Nisan 2011 - 01:36:28

« önceki - sonraki »

0 Üyeler ve 1 Ziyaretçi konuyu incelemekte.

decent

Ubumatic, Ubuntu 11.04/10.10/10.04 sürümlerinde en temel faaliyetleri yapılandırmak için tasarlanan bir betik.

ubumatic.sh
#!/bin/bash
# Ubumatic b110327 for Ubuntu 10.04 Lucid Lynx LTS, 10.10 Maverick Meerkat, 11.04 Natty Narwhal and other versions
# Description: Simple script to configure and manage the system
# License: GPLv3
# Author: empitt
# E-mail/XMPP: empitt@o2.pl
# Homepage: http://www.toplnx.pl
##    Ubumatic b110327
##    Copyright (C) 2011  Piotr Miros "empitt"
##
##    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/>.
export ac=`uname -m`
export ce=`lsb_release -cs`
export er='Not found:'
export hu=http://archive.ubuntu.com/ubuntu/
export lt=()
export me='main restricted universe multiverse'
export um=/tmp/ubumatic
export u1=$um/ubumatic_1
export u2=$um/ubumatic_2
export u3=$um/ubumatic_3
if [ $ac = x86_64 ] ; then
   export ah='64 bit (x86_64)'
else
   export ah='32 bit (x86)'
fi
if [ $ce = lucid ] ; then
   export cn='10.04 Lucid Lynx LTS'
elif [ $ce = maverick ] ; then
   export cn='10.10 Maverick Meerkat'
else
   export cn='11.04 Natty Narwhal'
fi
function pe () { zenity --width 500 --progress --title Ubumatic --text "$*. Please wait...\n\nIt may take from a few to several minutes" --pulsate --auto-close --percentage 15 ; }
function bb () {
   if [ ! -s /etc/apt/sources.list_backup ] ; then
      sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
   fi
   sudo bash -c "echo 'deb $hu $ce $me
deb-src $hu $ce $me
deb $hu $ce-updates $me
deb-src $hu $ce-updates $me
# deb $hu $ce-proposed $me
# deb-src $hu $ce-proposed $me
# deb $hu $ce-backports $me
# deb-src $hu $ce-backports $me
deb http://archive.canonical.com/ubuntu $ce partner
deb-src http://archive.canonical.com/ubuntu $ce partner
deb http://security.ubuntu.com/ubuntu $ce-security $me
deb-src http://security.ubuntu.com/ubuntu $ce-security $me
deb http://packages.medibuntu.org/ $ce free non-free
deb-src http://packages.medibuntu.org/ $ce free non-free
deb http://archive.getdeb.net/ubuntu $ce-getdeb apps games
deb-src http://archive.getdeb.net/ubuntu $ce-getdeb apps games' > /etc/apt/sources.list"
   if [ "$ce" = "maverick" -o "$ce" = "natty" ] ; then
      sudo sed -i "11i deb http://extras.ubuntu.com/ubuntu $ce main
         11i deb-src http://extras.ubuntu.com/ubuntu $ce main" /etc/apt/sources.list
   fi
   wget http://packages.medibuntu.org/medibuntu-key.gpg http://archive.getdeb.net/getdeb-archive.key -O - | sudo apt-key add -
   sudo apt-get update
   sudo apt-get -y --force-yes dist-upgrade
   echo sun-java6-jre shared/accepted-sun-dlj-v1-1 select true | sudo /usr/bin/debconf-set-selections
   il libavcodec-extra-52 libdvdcss2 p7zip-rar sun-java6-plugin ttf-mscorefonts-installer unrar
   if [ $ac = x86_64 ] ; then
      wget http://labs.adobe.com/downloads/flashplayer10_square.html -O /tmp/flashplayer.tar.gz
      sed -ni 's/.*\(http.\/\/download.macromedia.com\/pub\/labs\/flashplayer[0-9]\+\/flashplayer[0-9]\+.[0-9]\+.*64bit.linux.[0-9]\+.tar.gz\).*/\1/p' /tmp/flashplayer.tar.gz
      wget `sed -n p /tmp/flashplayer.tar.gz` -O /tmp/flashplayer.tar.gz
      tar xzf /tmp/flashplayer.tar.gz -C /tmp/ \
      && sudo mkdir -p /usr/lib/flashplugin \
      && sudo mv /tmp/libflashplayer.so /usr/lib/flashplugin/ \
      && sudo ln -sf /usr/lib/flashplugin/libflashplayer.so /usr/lib/mozilla/plugins/
      rm -f /tmp/flashplayer.tar.gz
   else
      il adobe-flashplugin
   fi
   }
function dk () { dpkg -l linux-image-2.6.*-generic | sed -n '/^ii/!d;$d;/'"`uname -r`"'/d;s/.* \([0-9.]\+-[0-9]\+\).*/\1/p' ; }
function il () { sudo apt-get -y --force-yes install $* ; }
function qn () {
   clear
   echo -e "\033[1m$*\033[0m"
   while : ; do
      echo -ne '\033[1m(Y)es/(N)o: \033[0m'
      read yn
      case $yn in
         y | Y | yes | Yes | YES )
            break
         ;;
         n | N | no | No | NO )
            clear
            exit 0
         ;;
      esac
   done
   }
function rr () {
   z=0
   while [ $z -ne 2 ] ; do
      sudo dpkg -a --configure
      sudo apt-get -fy --force-yes install
      z=$(( $z + 1 ))
   done
   }
function rt () {
   if [ $UID -ne 0 ] ; then
      echo 'Run script as a root (sudo script --option)'
      exit 0
   fi
   }
function tt () {
   if [ `lsb_release -is` = Ubuntu ] ; then
      if [ "$ac" = "x86_64" -o "$ac" = "i686" ] ; then
         true
      else
         echo Doesn\'t support this architecture
         exit 0
      fi
   else
      echo Doesn\'t support this operating system
      exit 0
   fi
   }
function uu () {
   tt ; rt ; qn "Configure the `lsb_release -ds` $ah
\033[0mSet recommended repository, install the latest updates, audio codecs, video,
DVD, etc., Flash and Java for web browsers, RAR and 7-Zip to compress and
decompress files and Windows fonts\033[0m"
   }
rm -rf $um
if [ "$1" = "--help" ] ; then
   clear
   echo -ne 'Ubumatic b110327 for Ubuntu 10.04 Lucid Lynx LTS, 10.10 Maverick Meerkat, 11.04
Natty Narwhal and other versions
Simple script to configure and manage the system
Configure the Ubuntu:
\tubumatic.sh
Additional options:
\t[ubumatic.sh --option]
\t--help - help
\t--movebuttons - change the order of buttons in Metacity
\t--restorecompiz - restore default settings in Compiz Fusion
\t--restorepanel - restore default appearance of panels in GNOME
\t--sonata - configure the music player MPD + Sonata
\t--unlock - the screen blocking off in GNOME (hibernate, suspend, screen
\t  saver)
\t[sudo ubumatic.sh --option]
\t--clean - remove unnecessary packages, downloaded and configuration
\t  files
\t--deletekernel - delete the old versions of kernels
\t--empty - clear trash and the Thumbnails folder for all accounts
\t--kubuntu - Kubuntu (KDE) basic configuration
\t--lubuntu - Lubuntu (LXDE) basic configuration
\t--repair - repair broken packages
\t--repositories - edit repository (sources.list), update alerts and
\t  download the missing GPG keys
\t--restoregrub - reinstall GRUB 2 (for Live CD use only)
\t--ubuntu - Ubuntu (GNOME) basic configuration
\t--upgrade - install the latest updates
\t--xubuntu - Xubuntu (Xfce) basic configuration

WARNING! Using the script at your own risk

Author: empitt
E-mail/XMPP: empitt@o2.pl
Homepage: http://www.toplnx.pl'
   read
   clear
   exit 0
elif [ "$1" = "" ] ; then
   for tr in synaptic zenity ; do
      if [ ! -x "`which $tr`" ] ; then
         lt="${lt[@]} $tr"
      fi
   done
   if [ "`echo ${lt[@]}`" ] ; then
      if [ -x /usr/bin/zenity ] ; then
         zenity --error --title Ubumatic --text "$er ${lt[@]}"
      elif [ -x /usr/bin/kdialog ] ; then
         kdialog --title Ubumatic --error "$er ${lt[@]}"
      else
         echo $er ${lt[@]}
      fi
      exit 0
   fi
   if [ "$ce" = "lucid" -o "$ce" = "maverick" -o "$ce" = "natty" ] ; then
      if [ "$ac" = "x86_64" -o "$ac" = "i686" ] ; then
         true
      else
         zenity --error --title Ubumatic --text "Doesn't support this architecture"
         exit 0
      fi
   else
      zenity --error --title Ubumatic --text "Doesn't support this operating system"
      exit 0
   fi
   zenity --entry --title Ubumatic --text 'Please enter your password' --hide-text | sudo -Su root true &> /dev/null
   if [ $? = 1 ] ; then
      exit 0
   fi
   while : ; do
      sudo -Su root true &> /dev/null
      sleep 1m
   done &
   sudo -S fuser /var/lib/dpkg/lock &>/dev/null
   if [ $? = 0 ] ; then
      zenity --error --title Ubumatic --text 'Another package manager is working in the background'
      killall `basename $0`
      exit 0
   fi
   st=`zenity --width 452 --height 274 --list --title 'Ubumatic b110327' --text "Configure the Ubuntu $cn $ah" --hide-column 2 --checklist --column '' --column '' --column 'Select options' --separator : \
TRUE 1 'Set the recommended repository (required)' \
TRUE 2 'Install the latest updates' \
FALSE 3 'Install the audio, video, DVD codecs, etc.' \
FALSE 4 'Install the Flash and Java for web browsers' \
FALSE 5 'Install RAR and 7-Zip to compress and decompress files' \
FALSE 6 'Install Windows fonts' \
FALSE 7 'Install Ubuntu Tweak for convenient system management'`
   if [ "$?" = "1" -o -z "$st" ] ; then
      killall `basename $0`
      exit 0
   fi
   mkdir -p $um
   : > $u1 > $u2 > $u3
   IFS=: ; for ar in $st ; do
      case $ar in
         1 )
            echo 1 >> $u1
            if [ "$ce" = "maverick" -o "$ce" = "natty" ] ; then
               echo 2 >> $u1
            fi
         ;;
         2 )
            echo 3 >> $u1
         ;;
         3 )
            echo 'libavcodec-extra-52 install
libdvdcss2 install
libmp4v2-0 install
gstreamer0.10-ffmpeg install
gstreamer0.10-plugins-bad install
gstreamer0.10-plugins-bad-multiverse install
gstreamer0.10-plugins-ugly install
gstreamer0.10-plugins-ugly-multiverse install' >> $u2
            if [ $ac = x86_64 ] ; then
               echo w64codecs install >> $u2
            else
               echo 'gstreamer0.10-pitfdll install
w32codecs install' >> $u2
            fi
            if [ "$ce" = "maverick" -o "$ce" = "natty" ] ; then
               echo gstreamer0.10-fluendo-mp3 install >> $u2
            fi
         ;;
         4 )
            echo sun-java6-plugin install >> $u2
            if [ $ac = x86_64 ] ; then
               echo http://labs.adobe.com/downloads/flashplayer10_square.html > $um/flashplayer.tar.gz
            else
               echo adobe-flashplugin install >> $u2
            fi
         ;;
         5 )
            echo 'p7zip-rar install
unrar install' >> $u2
         ;;
         6 )
            echo ttf-mscorefonts-installer install >> $u2
         ;;
         7 )
            if [ $ce = lucid ] ; then
               echo 4 >> $u1
            fi
            echo ubuntu-tweak install >> $u2
         ;;
      esac
   done
   if [ -s "$u1" -o -s "$u2" ] ; then
      ( wget -q -t 5 -T 3 http://www.toplnx.pl/files/connection -O $u3 & ) | pe 'Checking internet connection'
      if [ $? = 1 ] ; then
         killall wget &> /dev/null
      fi
      if [ ! -s $u3 ] ; then
         rm -rf $um
         zenity --error --title Ubumatic --text 'Internet connection failure'
         killall `basename $0`
         exit 0
      fi
   fi
   if [ "`sed -n '/1/p' $u1`" -o "`sed -n '/2/p' $u1`" -o "`sed -n '/4/p' $u1`" ] ; then
      { (
      if [ `sed -n '/1/p' $u1` ] ; then
         if [ ! -s /etc/apt/sources.list_backup ] ; then
            sudo -S cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
         fi
         sudo -S bash -c "echo 'deb $hu $ce $me
deb-src $hu $ce $me
deb $hu $ce-updates $me
deb-src $hu $ce-updates $me
# deb $hu $ce-proposed $me
# deb-src $hu $ce-proposed $me
# deb $hu $ce-backports $me
# deb-src $hu $ce-backports $me
deb http://archive.canonical.com/ubuntu $ce partner
deb-src http://archive.canonical.com/ubuntu $ce partner
deb http://security.ubuntu.com/ubuntu $ce-security $me
deb-src http://security.ubuntu.com/ubuntu $ce-security $me
deb http://packages.medibuntu.org/ $ce free non-free
deb-src http://packages.medibuntu.org/ $ce free non-free
deb http://archive.getdeb.net/ubuntu $ce-getdeb apps games
deb-src http://archive.getdeb.net/ubuntu $ce-getdeb apps games' > /etc/apt/sources.list"
         if [ `sed -n '/2/p' $u1` ] ; then
            sudo -S sed -i "11i deb http://extras.ubuntu.com/ubuntu $ce main
               11i deb-src http://extras.ubuntu.com/ubuntu $ce main" /etc/apt/sources.list
         fi
         sudo -S apt-key adv --keyserver x-hkp://gpg-keyserver.de --recv-keys 2EBC26B60C5A2783 A8A515F046D7E7CF &> /dev/null
      fi
      if [ `sed -n '/4/p' $u1` ] ; then
         sudo -S add-apt-repository ppa:tualatrix/ppa &> /dev/null
      fi
      ) & } | pe 'Configuration repository loading'
      if [ $? = 1 ] ; then
         sudo -S killall add-apt-repository apt-key &> /dev/null
      fi
   fi
   if [ -s "$u1" -o -s "$u2" ] ; then
      sudo -S synaptic -t Ubumatic --hide-main-window --non-interactive --update-at-startup
   fi
   if [ `sed -n '/3/p' $u1` ] ; then
      sudo -S synaptic -t Ubumatic --hide-main-window --non-interactive --dist-upgrade-mode
   fi
   if [ -s $u2 ] ; then
      zenity --warning --title Ubumatic --text 'Not all packages can be installed if you have not\nselected an option that sets the repository' --timeout 5
      sudo -S synaptic -t Ubumatic --hide-main-window --non-interactive --set-selections-file $u2
   fi
   if [ -s $um/flashplayer.tar.gz ] ; then
      { (
      wget -q "`sed -n p $um/flashplayer.tar.gz`" -O $um/flashplayer.tar.gz &> /dev/null
      sed -ni 's/.*\(http.\/\/download.macromedia.com\/pub\/labs\/flashplayer[0-9]\+\/flashplayer[0-9]\+.[0-9]\+.*64bit.linux.[0-9]\+.tar.gz\).*/\1/p' $um/flashplayer.tar.gz &> /dev/null
      wget -q "`sed -n p $um/flashplayer.tar.gz`" -O $um/flashplayer.tar.gz &> /dev/null
      tar xzf $um/flashplayer.tar.gz -C $um/ &> /dev/null && : > $u3 || echo false > $u3 \
      && sudo -S mkdir -p /usr/lib/flashplugin \
      && sudo -S mv $um/libflashplayer.so /usr/lib/flashplugin/ \
      && sudo -S ln -sf /usr/lib/flashplugin/libflashplayer.so /usr/lib/mozilla/plugins/
      ) & } | pe 'Downloading and installing the Flash '
      if [ $? = 1 ] ; then
         killall wget &> /dev/null
      fi
      if [ -s $u3 ] ; then
         zenity --error --title Ubumatic --text 'Flash install failure'
      fi
   fi
   if [ -s "$u1" -o -s "$u2" ] ; then
      (
      x=0
      while [ $x -ne 2 ] ; do
         sudo -S dpkg -a --configure &> /dev/null
         sudo -S apt-get -fy --force-yes install &> /dev/null
         x=$(( $x + 1 ))
      done
      ) | while : ; do
         pe 'Checking and fixing the problems if neccesary'
         if [ $? = 0 ] ; then
            break
         fi
      done
      zenity --question --title Ubumatic --text 'Do you want to remove files to free up some hard disk space?'
      if [ $? = 0 ] ; then
         ( sudo apt-get clean &> /dev/null ) | while : ; do
            pe 'Deleting downloaded files'
            if [ $? = 0 ] ; then
               break
            fi
         done
      fi
   fi
   rm -rf $um
   zenity --info --title Ubumatic --text 'Finished\n\nUbumatic b110327 for Ubuntu 10.04 Lucid Lynx LTS,\n10.10 Maverick Meerkat and 11.04 Natty Narwhal\n\nAuthor: empitt\nE-mail/XMPP: empitt@o2.pl\nHomepage: http://www.toplnx.pl'
   killall `basename $0`
   exit 0
elif [ "$1" = "--clean" ] ; then
   tt ; rt ; qn Remove unnecessary packages, downloaded and configuration files
   sudo apt-get -y --purge autoremove
   dpkg -l | sed -n 's/^rc *\([^ ]\+\).*/\1/p' | xargs sudo dpkg -P
   sudo apt-get clean
elif [ "$1" = "--deletekernel" ] ; then
   tt ; rt ; qn "Delete the old versions of kernels: \033[0m`dk`\033[0m"
   dk | xargs sudo apt-get -y --force-yes purge
elif [ "$1" = "--empty" ] ; then
   tt ; rt ; qn 'Clear trash and the Thumbnails folder for all accounts'
   sudo rm -rf /home/*/.local/share/Trash/*/**
   sudo rm -rf /root/.local/share/Trash/*/**
   sudo rm -rf /home/*/.thumbnails/*/**
   sudo rm -rf /root/.thumbnails/*/**
elif [ "$1" = "--kubuntu" ] ; then
   uu ; bb
   il kopete-gcall lame libdvdread4 libk3b6-extracodecs libmp3lame0 libtunepimp5-mp3 libxine1-ffmpeg
   rr
elif [ "$1" = "--lubuntu" ] ; then
   uu ; bb
   il chromium-codecs-ffmpeg-extra libmp4v2-0
   rr
elif [ "$1" = "--movebuttons" ] ; then
   if [ ! -x /usr/bin/zenity ] ; then
      echo Zenity not found
      exit 0
   fi
   tt
   st=`zenity --width 214 --height 205 --list --title Ubumatic --text 'Change the order of buttons' --hide-column 2 --radiolist --column '' --column '' --column 'Select an option' \
   TRUE 1 'Right' \
   FALSE 2 'Left' \
   FALSE 3 'Custom settings' \
   FALSE 4 'Default settings'`
   case $st in
      1 )
         gconftool-2 -t str -s /apps/metacity/general/button_layout :minimize,maximize,close
      ;;
      2 )
         gconftool-2 -t str -s /apps/metacity/general/button_layout close,minimize,maximize:
      ;;
      3 )
         tx=`zenity --width 300 --entry --title Ubumatic --text 'Enter your own value' --entry-text close,minimize,maximize:menu`
         if [ $? = 0 ] ; then
            gconftool-2 -t str -s /apps/metacity/general/button_layout $tx
         fi
      ;;
      4 )
         gconftool-2 --recursive-unset /apps/metacity/general/button_layout
      ;;
      * )
         clear
         exit 0
      ;;
   esac
   zenity --info --title Ubumatic --text 'Finished\n\nUbumatic b110327 for Ubuntu\n\nAuthor: empitt\nE-mail/XMPP: empitt@o2.pl\nHomepage: http://www.toplnx.pl'
   clear
   exit 0
elif [ "$1" = "--repair" ] ; then
   tt ; rt ; qn Repair broken packages
   rr
elif [ "$1" = "--repositories" ] ; then
   tt ; rt ; qn 'Edit repository (sources.list), update alerts and download the missing GPG keys'
   sudo nano /etc/apt/sources.list
   y=0
   while [ $y -ne 2 ] ; do
      sudo apt-get update 2> $um
      sed -ni 's/.*NO_PUBKEY //p' $um
      gpg --keyserver 'x-hkp://gpg-keyserver.de' --recv-keys `sed -n p $um`
      gpg --export --armor `sed -n p $um` | sudo apt-key add -
      y=$(( $y + 1 ))
   done
   rm -rf $um
elif [ "$1" = "--restorecompiz" ] ; then
   tt ; qn Restore default settings in Compiz Fusion
   gconftool-2 --recursive-unset /apps/compiz
elif [ "$1" = "--restoregrub" ] ; then
   function pn () { sudo fdisk -l | sed -n 's/\(\/dev\/[a-z]\+[0-9]\+\).*/\1/p' ; }
   if [ ! -x /usr/bin/zenity ] ; then
      echo Zenity not found
      exit 0
   fi
   tt ; rt
   zenity --question --title Ubumatic --text 'Do not run the restore GRUB 2 on installed\nUbuntu as it is intended for the Live CD.\n\nDo you want to continue?'
   if [ $? = 1 ] ; then
      clear
      exit 0
   fi
   clear
   echo Following hard disks are detected:
   sudo fdisk -l
   sleep 1
   while : ; do
      zenity --entry --title Ubumatic --text "Mount / with Ubuntu, (space) /boot, (space) /var on partions:\n`pn`\n\n* - if you do not set the /boot and /var, enter the following 0 (no),\ne.g.: /dev/sda1 0 0 (/),/dev/sda1 /dev/sda2 0 (/ and /boot),\n/dev/sda1 0 /dev/sda3 (/ and /var) etc." --entry-text '/dev/sda1 0 0' > $um
      if [ $? = 0 ] ; then
         break
      fi
   done
   while : ; do
      zenity --entry --title Ubumatic --text "Install bootstrap loader on:\n· disk MBR (recommended):\n`sudo fdisk -l | sed -n 's/[^ ]\+ \(\/dev\/[a-z]\+\).*/\1/p'`\n· or partion:\n`pn`" --entry-text /dev/sda >> $um
      if [ $? = 0 ] ; then
         break
      fi
   done
   zenity --question --title Ubumatic --text "· Mount:\n/\ - `sed -n '1s/\([^ ]\+\) \([^ ]\+\) \([^ ]\+\)/\1\n\/boot - \2\n\/var - \3/p' $um`\n· GRUB 2:\n`sed -n 2p $um`\n\nDo you want to continue?"
   if [ $? = 1 ] ; then
      rm -rf $um
      clear
      exit 0
   fi
   (
   sudo mount "`sed -n '1s/\([^ ]\+\) [^ ]\+ [^ ]\+/\1/p' $um`" /mnt &> /dev/null
   sudo mount "`sed -n '1s/[^ ]\+ \([^ ]\+\) [^ ]\+/\1/p' $um`" /mnt/boot &> /dev/null
   sudo mount "`sed -n '1s/[^ ]\+ [^ ]\+ \([^ ]\+\)/\1/p' $um`" /mnt/var &> /dev/null
   sudo mount --bind /dev /mnt/dev &> /dev/null
   sudo mount --bind /dev/pts /mnt/dev/pts &> /dev/null
   sudo mount --bind /proc /mnt/proc &> /dev/null
   sudo mount --bind /sys /mnt/sys &> /dev/null
   sudo chroot /mnt &> /dev/null <<EOF
grub-install `sed -n 2p $um`
update-grub
EOF
   sudo umount /mnt/dev/pts &> /dev/null
   sudo umount /mnt/dev &> /dev/null
   sudo umount /mnt/proc &> /dev/null
   sudo umount /mnt/sys &> /dev/null
   sudo umount /mnt/boot &> /dev/null
   sudo umount /mnt/var &> /dev/null
   sudo umount /mnt &> /dev/null
   ) | while : ; do
      zenity --width 500 --progress --title Ubumatic --text 'Please wait...\n\nIt may take several minutes' --pulsate --auto-close --percentage 15
      if [ $? = 0 ] ; then
         break
      fi
   done
   zenity --question --title Ubumatic --text 'Finished\n\nUbumatic b110327 for Ubuntu\n\nAuthor: empitt\nE-mail/XMPP: empitt@o2.pl\nHomepage: http://www.toplnx.pl\n\nDo you want to restart your computer?'
   if [ $? = 0 ] ; then
      sudo reboot
   else
      rm -rf $um
      clear
      exit 0
   fi
elif [ "$1" = "--restorepanel" ] ; then
   tt ; qn Restore default appearance of panels in GNOME
   gconftool-2 --recursive-unset /apps/panel
elif [ "$1" = "--sonata" ] ; then
   tt ; qn Configure the music player MPD + Sonata
   if [ -x "/usr/bin/mpd" -a -x "/usr/bin/sonata" ] ; then
      mkdir -p $HOME/.mpd/music $HOME/.mpd/playlists
      if [ ! -d $HOME/Music ] ; then
         mkdir $HOME/Music
      fi
      ln -sf $HOME/Music $HOME/.mpd/music/
      echo "music_directory \"~/.mpd/music\"
playlist_directory \"~/.mpd/playlists\"
db_file \"~/.mpd/tag_cache\"
log_file \"~/.mpd/mpd.log\"
pid_file \"~/.mpd/pid\"
state_file \"~/.mpd/state\"
user \"$USER\"
bind_to_address \"127.0.0.1\"
port \"6666\"
input {
plugin \"curl\"
}
audio_output {
type \"pulse\"
name \"My Pulse Output\"
}
mixer_type \"software\"
filesystem_charset \"UTF-8\"
id3v1_encoding \"UTF-8\"" > $HOME/.mpd/mpd.conf
      mpd --kill
      mpd --create-db $HOME/.mpd/mpd.conf
      mkdir -p $HOME/.config/autostart
      echo '
[Desktop Entry]
Type=Application
Exec=mpd .mpd/mpd.conf
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[pl_PL]=MPD
Name=MPD
Comment[pl_PL]=
Comment=' > $HOME/.config/autostart/mpd.desktop
      mkdir -p $HOME/.config/sonata
      echo "[profiles]
names[0] = Domyślny profil
num_profiles = 1
passwords[0] =
hosts[0] = localhost
ports[0] = 6666
musicdirs[0] = $HOME" > $HOME/.config/sonata/sonatarc
   else
      echo MPD and Sonata isn\'t installed
   fi
elif [ "$1" = "--ubuntu" -o "$1" = "--xubuntu" ] ; then
   uu ; bb
   il gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libmp4v2-0
   if [ $ac = i686 ] ; then
      il gstreamer0.10-pitfdll
   fi
   if [ "$ce" = "maverick" -o "$ce" = "natty" ] ; then
      il gstreamer0.10-fluendo-mp3
   fi
   rr
elif [ "$1" = "--unlock" ] ; then
   tt ; qn 'The screen blocking off in GNOME (hibernate, suspend, screen saver)'
   gconftool-2 -t bool -s /apps/gnome-power-manager/lock/hibernate false
   gconftool-2 -t bool -s /apps/gnome-power-manager/lock/suspend false
   gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false
elif [ "$1" = "--upgrade" ] ; then
   tt ; rt ; qn Install the latest updates
   sudo apt-get update
   sudo apt-get -y --force-yes dist-upgrade
else
   echo An option doesn\'t exist
   exit 0
fi
clear
echo -n 'Finished

Ubumatic b110327 for Ubuntu

Author: empitt
E-mail/XMPP: empitt@o2.pl
Homepage: http://www.toplnx.pl'
read
clear
exit 0



Ubumatic ne işe yarar ?

>> Depo ayarlamaları
>> Sistem güncellemeleri
>> Çoklu ortam çözücülerinin kurulumu  (install multimedia codecs)
>> Flash ve Java kurulumu  (Ubuntu 64 bit Ubuntu için Flash 64 bit sürümü - Sun/Oracle)
>> RAR ve 7-Zip kurulumları
>> Windows yazıtipleri kurulumu
>> Ubuntu Tweak kurulumu

Ubumatic temel sürüm ekran görüntüsü:



Peki nasıl çalıştıracağız?
Ubumatic indir [ md5sum: 4c998041a150f6cc1f45ff8af32ffd2f ] - 6.3 KB
- Dosyayı indirdikten sonra arşivden çıkartın. (Dosya yolu doğru olmalı)
- Aşağıdaki komutları uçbirimde yazarak uygulayın,

tar -zxvf ubumatic_en.tar.gz
cd ubumatic_en
sudo chmod 755 ubumatic.sh
sudo sh ubumatic.sh





Başka ne işe yarar ?
Aşağıda sıralandığı gibi, mesela Çalışan CD ile yeniden grub kurulumu bile yapabilirsiniz. :)



[ubumatic.sh --option]

--help - help

--movebuttons - change the order of buttons in Metacity

--restorecompiz - restore default settings in Compiz Fusion

--restorepanel - restore default appearance of panels in GNOME

--sonata - configure the music player MPD + Sonata

--unlock - the screen blocking off in GNOME (hibernate, suspend, screen saver)





[sudo ubumatic.sh --option]

--clean - remove unnecessary packages, downloaded and configuration files

--deletekernel - delete the old versions of kernels

--empty - clear trash and the Thumbnails folder for all accounts

--kubuntu - Kubuntu (KDE) basic configuration

--lubuntu - Lubuntu (LXDE) basic configuration

--repair - repair broken packages

--repositories - edit repository (sources.list), update alerts and download the missing GPG keys

--restoregrub - reinstall GRUB 2 (for Live CD use only)

--ubuntu - Ubuntu (GNOME) basic configuration

--upgrade - install the latest updates

--xubuntu - Xubuntu (Xfce) basic configuration

Alıntı YapScreenshot of the script with the option of reinstalling GRUB 2 from the Ubuntu Live CD (Desktop):



Double-click the left mouse button and select Run to run basic script but with the additional option you must type the command in a terminal sample:
sudo /home/username/Downloads/ubumatic.sh --restoregrub

Kaynaklar:
Anasayfa
Ubuntugeek