Guest
Public paste!

root

By: a guest | May 8th, 2009 | Syntax: None | Size: 10.95 KB | Hits: 52 | Expires: Never
Copy text to clipboard
  1. #!/bin/bash
  2. # To install this file:  download it by saving it to your desktop, or wherever.
  3. # Then, right-click the file, click Properties, and choose the Permissions tab.
  4. # Check off "Allow Executing File as Program".
  5. # Now, just run the file in terminal.
  6.  
  7. # For example:
  8. # cd ~/Desktop
  9. # ./perfectbuntu
  10.  
  11. # Now for the code.  Don't worry about any of this stuff.  It's just nonsense.  ;)
  12. echo
  13. echo perfectbuntu
  14. echo SCRIPT VERSION 2.1
  15. echo By Robbie Ferguson \(www.Category5.TV\)
  16. echo This script was originally based on http://www.category5.tv/content/view/77/38/
  17. echo
  18.  
  19. # Detect version of Ubuntu
  20. grep "DISTRIB_RELEASE=8.04" /etc/lsb-release > /dev/null 2>&1
  21. if [ $? = 0 ]; then
  22. OSVER="hardy"
  23. fi
  24. grep "DISTRIB_RELEASE=8.10" /etc/lsb-release > /dev/null 2>&1
  25. if [ $? = 0 ]; then
  26. OSVER="intrepid"
  27. fi
  28. grep "DISTRIB_RELEASE=9.04" /etc/lsb-release > /dev/null 2>&1
  29. if [ $? = 0 ]; then
  30. OSVER="jaunty"
  31. fi
  32.  
  33. # set default bit to 32
  34. BIT="32"
  35.  
  36. if [[ `uname -m` == 'amd64' || `uname -m` == 'x86_64' ]]; then
  37. BIT="64"
  38. fi
  39.  
  40. echo "Detected version:" $OSVER, $BIT"-bit"
  41.  
  42. if [[ $OSVER != 'hardy' && $OSVER != 'intrepid' && $OSVER != 'jaunty' ]]; then
  43.    echo "Your version of Linux is not supported."
  44.    echo
  45.    exit
  46. fi
  47.  
  48. # Running a supported version of *buntu.  Move on.
  49.  
  50. echo
  51. echo This script requires super-user access to continue.
  52. echo Checking for super-user access...
  53. #sleep 5
  54. sudo echo Access Granted.
  55. echo I might have to ask for your password again...
  56. echo
  57. echo Now, I\'ll ask you a bunch of questions, and then get right to work.
  58. echo
  59.  
  60. # Ask all the questions...
  61.  
  62. echo "Installing restricted multimedia codecs might violate"
  63. echo "patent and/or other laws.  Please make sure you have"
  64. echo "the right to use these codecs."
  65. echo
  66. read -p "Install Multimedia Codecs and Restricted Extras? (Y/N) "
  67. if [ "$REPLY" = "y" ] ; then
  68.   MULTIMEDIA="1"
  69. fi
  70. if [ "$REPLY" = "Y" ] ; then
  71.   MULTIMEDIA="1"
  72. fi
  73. echo
  74.  
  75. echo "I can install and configure the Flash plugin for you."
  76. echo "First, I'll close your browser..."
  77. echo "Then I'll remove your old Flash plugin..."
  78. echo "Then I'll install the new Flash plugin."
  79. echo
  80. read -p "Do you want me to do that (Flash Plugin)? (Y/N) "
  81. if [ "$REPLY" = "y" ] ; then
  82.   FLASH="1"
  83. fi
  84. if [ "$REPLY" = "Y" ] ; then
  85.   FLASH="1"
  86. fi
  87. echo
  88.  
  89. read -p "Does your computer have a DVD player? (Y/N) "
  90. if [ "$REPLY" = "y" ] ; then
  91.   DVD="1"
  92. fi
  93. if [ "$REPLY" = "Y" ] ; then
  94.   DVD="1"
  95. fi
  96. echo
  97.  
  98. read -p "Do you want spam filters for Evolution? (Y/N) "
  99. if [ "$REPLY" = "y" ] ; then
  100.   SPAM="1"
  101. fi
  102. if [ "$REPLY" = "Y" ] ; then
  103.   SPAM="1"
  104. fi
  105. echo
  106.  
  107. echo I can install a huge number of fonts which you can use in
  108. echo your word processor, or even in programs like The GIMP.
  109. read -p "Would you like a bunch of new fonts? (Y/N) "
  110. if [ "$REPLY" = "y" ] ; then
  111.   FONTS="1"
  112. fi
  113. if [ "$REPLY" = "Y" ] ; then
  114.   FONTS="1"
  115. fi
  116. echo
  117.  
  118. echo wine is an application that allows you to run some
  119. echo Windows programs directly in Linux \(.exe files\).
  120. read -p "Should I install this for you? (Y/N) "
  121. if [ "$REPLY" = "y" ] ; then
  122.   WINE="1"
  123. fi
  124. if [ "$REPLY" = "Y" ] ; then
  125.   WINE="1"
  126. fi
  127. echo
  128.  
  129. echo Avant is a very nice dockbar for Linux.
  130. echo Would you like avant-window-navigator?
  131. read -p "Should I install this for you? (Y/N) "
  132. if [ "$REPLY" = "y" ] ; then
  133.   AWN="1"
  134. fi
  135. if [ "$REPLY" = "Y" ] ; then
  136.   AWN="1"
  137. fi
  138. echo
  139.  
  140. read -p "Should I install Skype for you? (Y/N) "
  141. if [ "$REPLY" = "y" ] ; then
  142.   SKYPE="1"
  143. fi
  144. if [ "$REPLY" = "Y" ] ; then
  145.   SKYPE="1"
  146. fi
  147. echo
  148.  
  149. echo "I can make it so you can use 7z, ZIP, Zip64, CAB, RAR, ARJ,"
  150. echo "GZIP, BZIP2, TAR, CPIO, RPM, ISO and DEB archives in file-roller."
  151. read -p "Do you want me to do this? (Y/N) "
  152. if [ "$REPLY" = "y" ] ; then
  153.   COMPRESSION="1"
  154. fi
  155. if [ "$REPLY" = "Y" ] ; then
  156.   COMPRESSION="1"
  157. fi
  158. echo
  159.  
  160.  
  161. echo This script does not come with or even imply any kind of warranty.
  162. echo If your system breaks, you take full responsibility.
  163. read -p "I am about to modify your system.  Are you sure this is okay? (Y/N) "
  164. if [ "$REPLY" = "y" ] ; then
  165.   GO="1"
  166. fi
  167. if [ "$REPLY" = "Y" ] ; then
  168.   GO="1"
  169. fi
  170. if [ "$REPLY" = "N" ] ; then
  171.   echo Exiting.
  172. fi
  173. if [ "$REPLY" = "n" ] ; then
  174.   echo Exiting.
  175. fi
  176. echo
  177.  
  178. # End of questions
  179.  
  180. # Only proceed if the user accepted the brief "you break it, it's your fault" disclaimer
  181. if [ "$GO" = "1" ]; then
  182.  
  183. cd ~
  184. if [ ! -e ".perfectbuntu/datafile10" ]       # Check if file exists.
  185.   then
  186.     echo This is apparently the first time you have run this script.
  187.     echo
  188.     echo Backing up your APT sources.list file to /etc/apt/sources.list.backup...
  189.     sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
  190.     echo Done.
  191.     echo
  192.     echo Creating your APT entries now.
  193.     mkdir ~/.perfectbuntu
  194.     echo "Do not delete this file." >> ~/.perfectbuntu/datafile10
  195.     echo "" >> ~/.perfectbuntu/sources10
  196.     echo "# Added by perfectbuntu - www.category5.tv" >> ~/.perfectbuntu/sources10
  197.  
  198. # Avoid duplicates by using grep
  199.     if grep 'main restricted universe multiverse'$ /etc/apt/sources.list > /dev/null; then
  200.         echo "Omitting duplicate..."
  201.     else
  202.     echo "deb http://ca.archive.ubuntu.com/ubuntu/ "$OSVER" main restricted universe multiverse" >> ~/.perfectbuntu/sources10      
  203.     fi
  204.  
  205.     if grep 'main restricted'$ /etc/apt/sources.list > /dev/null; then
  206.         echo "Omitting duplicate..."
  207.     else
  208.     echo "deb-src http://ca.archive.ubuntu.com/ubuntu/ "$OSVER" main restricted" >> ~/.perfectbuntu/sources10
  209.     fi
  210.  
  211.     if grep 'free non-free'$ /etc/apt/sources.list > /dev/null; then
  212.         echo "Omitting duplicate..."
  213.     else
  214.     echo "deb http://packages.medibuntu.org/ "$OSVER" free non-free" >> ~/.perfectbuntu/sources10
  215.     fi
  216.  
  217.     if grep 'deb http://ppa.launchpad.net/reacocard-awn/ubuntu '$OSVER' main'$ /etc/apt/sources.list > /dev/null; then
  218.         echo "Omitting duplicate..."
  219.     else
  220.     echo "deb http://ppa.launchpad.net/reacocard-awn/ubuntu "$OSVER" main" >> ~/.perfectbuntu/sources10
  221.     fi
  222.  
  223.     if grep 'deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu '$OSVER' main'$ /etc/apt/sources.list > /dev/null; then
  224.         echo "Omitting duplicate..."
  225.     else
  226.     echo "deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu "$OSVER" main" >> ~/.perfectbuntu/sources10
  227.     fi
  228.  
  229.         cat ~/.perfectbuntu/sources10 | sudo tee -a /etc/apt/sources.list
  230.     echo Done.
  231.     echo
  232.    fi
  233.  
  234. echo Retrieving GPG Signatures...
  235. sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list; sudo apt-get -q update; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring; sudo apt-get -q update
  236. echo Done.
  237. echo
  238.  
  239. echo Cleaning up apt...
  240. sudo apt-get clean
  241. echo Done.
  242. echo
  243.  
  244. echo Updating apt...
  245. sudo apt-get update
  246. echo Done.
  247. echo
  248.  
  249.  
  250.  
  251. #Run the installers
  252.  
  253. if [ "$FLASH" = "1" ]; then
  254. echo Closing your browser windows...
  255. killall -9 firefox
  256. echo Removing your old Flash plugin...
  257.  
  258. sudo apt-get --force-yes -y -f -m --purge remove flashplugin-nonfree adobe-flashplugin flashplugin-installer
  259.  
  260. echo Installing Flash plugin installer...
  261. sudo apt-get --force-yes -y -f -m install flashplugin-installer
  262. echo Done.
  263. echo
  264. fi
  265.  
  266. if [ "$MULTIMEDIA" = "1" ]; then
  267. echo Installing multimedia codecs...
  268. sudo apt-get --force-yes -y -f -m install ubuntu-restricted-extras
  269. sudo apt-get --force-yes -y -f -m install gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg libxine1-ffmpeg libdvdread3
  270. sudo apt-get -y -f -m install "w"$BIT"codecs"
  271. echo Done.
  272. echo
  273. fi
  274.  
  275. if [ "$FONTS" = "1" ]; then
  276. echo Installing roughly a billion fonts...
  277. sudo apt-get -y -f -m install msttcorefonts
  278. echo
  279. echo NOTE: That should be the last EULA you\'ll have to deal with.
  280. echo You can go get a coffee now while I finish up.
  281. echo It\'s going to take a while.
  282. echo
  283. echo Continuing with font installations...
  284. sudo apt-get -y -f -m install ttf-gentium ttf-dustin ttf-georgewilliams ttf-sjfonts sun-java6-fonts ttf-larabie-deco ttf-larabie-straight ttf-larabie-uncommon ttf-linux-libertine ttf-mgopen ttf-sil-charis ttf-sil-doulos ttf-ubuntu-title gsfonts-x11 ttf-fifthhorseman-dkg-handwriting ttf-alee ttf-alee ttf-ancient-fonts ttf-arhangai ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-ukai ttf-atarismall ttf-baekmuk ttf-bengali-fonts ttf-beteckna ttf-bpg-georgian-fonts ttf-breip ttf-devanagari-fonts ttf-dzongkha ttf-ecolier-court ttf-essays1743 ttf-f500 ttf-farsiweb ttf-freefarsi ttf-gfs-artemisia ttf-gfs-bodoni-classic ttf-gfs-complutum ttf-gfs-didot-classic ttf-gfs-gazis ttf-gfs-neohellenic ttf-gfs-solomos ttf-gfs-theokritos ttf-gujarati-fonts ttf-inconsolata ttf-indic-fonts ttf-isabella ttf-junicode ttf-kacst ttf-kannada-fonts ttf-khmeros ttf-kiloji ttf-kochi-gothic-naga10 ttf-kochi-mincho-naga10 ttf-konatu ttf-liberation ttf-manchufont ttf-marvosym ttf-mikachan ttf-mona ttf-mph-2b-damase ttf-nafees ttf-ocr-a ttf-oflb-euterpe ttf-oriya-fonts ttf-paktype ttf-punjabi-fonts ttf-radisnoir ttf-sazanami-gothic ttf-sazanami-mincho ttf-sil-abyssinica ttf-sil-andika ttf-sil-ezra ttf-sil-padauk ttf-sil-scheherazade ttf-sil-yi ttf-staypuft ttf-summersby ttf-tamil-fonts ttf-tmuni ttf-tuffy ttf-unfonts ttf-unfonts-extra ttf-uralic ttf-vlgothic ttf-wqy-zenhei ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac
  285. echo Done.
  286. echo
  287. fi
  288.  
  289. if [ "$DVD" = "1" ]; then
  290. echo Installing DVD decoders and support files...
  291. sudo apt-get -y -f -m install libdvdcss2 libdvdread3 ffmpeg "w"$BIT"codecs"
  292. echo Done.
  293. echo
  294. fi
  295.  
  296. if [ "$AWN" = "1" ]; then
  297. echo Installing avant-window-navigator Dockbar...
  298. # Used to install the BZR, but now the stable version has been updated so it's not necessary
  299. #sudo apt-get --force-yes -y -f -m install awn-manager-bzr
  300. #sudo apt-get --force-yes -y -f -m install avant-window-navigator-bzr avant-window-navigator-data
  301. # Install the stable version instead
  302. sudo apt-get --force-yes -y -f -m install avant-window-navigator awn-applets-c-extras awn-manager
  303. echo Done.
  304. echo
  305. fi
  306.  
  307. if [ "$COMPRESSION" = "1" ]; then
  308. echo Installing support for multiple archive types in file-roller...
  309. sudo apt-get -y -f -m install lzma unrar rar p7zip p7zip-full p7zip-rar
  310. echo Done.
  311. echo
  312. fi
  313.  
  314. if [ "$WINE" = "1" ]; then
  315. echo Installing wine...
  316. sudo apt-get -y -f -m install wine
  317. echo Done.
  318. echo
  319. fi
  320.  
  321. if [ "$SKYPE" = "1" ]; then
  322. echo Installing Skype...
  323. sudo apt-get -y -f -m install skype
  324. echo Done.
  325. echo
  326. fi
  327.  
  328. if [ "$SPAM" = "1" ]; then
  329. echo Installing SPAM filters...
  330. sudo apt-get -y -f -m install spamassassin
  331. echo Done.
  332. echo
  333. fi
  334.  
  335. # Install stuff that everyone should have (no prompt)
  336. # xnest updates Terminal Server Client to support the XDMCP protocol allowing you to connect to other Linux machines.  It's strange this isn't included out-of-the-box.
  337. echo "I'm going to install some things that everyone should have..."
  338. echo
  339. echo "Installing support for XDMCP (remote desktop for Linux, essentially)..."
  340. sudo apt-get -y -f -m install xnest
  341. echo Done.
  342. echo
  343. # CCSM allows you to customize your special effects and all settings in Compiz.
  344. echo Installing CCSM advanced visual effects for Compiz Fusion...
  345. sudo apt-get -y -f -m install compizconfig-settings-manager
  346. echo Done.
  347. echo
  348.  
  349. echo All done.  Enjoy the Perfect *buntu!
  350. echo Visit www.category5.tv/content/view/164/77
  351.  
  352. fi