firefox-install.sh


SUBMITTED BY: Guest

DATE: Nov. 13, 2013, 9:21 p.m.

FORMAT: Text only

SIZE: 3.1 kB

HITS: 892

  1. #!/bin/bash
  2. # Script to install Firefox on GNU/Linux
  3. # Created by kikee (kikee@mailoo.org)
  4. # Licensed by GPL v.2
  5. # --------------------------------------
  6. # [Variables]
  7. VERSION=23.0.1
  8. # Version of Firefox to install.
  9. LANGUAGE=es-ES
  10. # Language to install, change to en-US for english.
  11. ARCH=linux-i686
  12. # Architecture of your system, change to "linux-x86_64" for 64-bit.
  13. DOWNLOADER=wget
  14. # You also use aria2c and axel to download.
  15. SERVER=ftp://ftp.mozilla.org/pub/firefox/releases/$VERSION/$ARCH/$LANGUAGE/firefox-$VERSION.tar.bz2
  16. # Server to use, alternative server:
  17. # http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/$ARCH/$LANGUAGE/firefox-$VERSION.tar.bz2
  18. # --------------------------------------
  19. # [Download and install]
  20. if [ $USER != root ]; then
  21. echo "Error: must be root"
  22. echo "Exiting..."
  23. exit 0
  24. fi
  25. clear
  26. echo "This script will install the following:"
  27. echo ""
  28. echo "Package: Mozilla Firefox"
  29. echo "Version: $VERSION"
  30. echo "Language: $LANGUAGE"
  31. echo "Arch: $ARCH"
  32. echo ""
  33. echo "Downloader to use: $DOWNLOADER"
  34. echo ""
  35. echo -n "Is correct (y/n) " ; read var
  36. case $var in
  37. y)
  38. echo ""
  39. echo " <-Downloading Mozilla Firefox->"
  40. cd /tmp/
  41. $DOWNLOADER $SERVER
  42. echo " <-Installing Mozilla Firefox->"
  43. tar jxvf firefox-$VERSION.tar.bz2 -C /opt/
  44. rm -rf /usr/bin/firefox
  45. ln -s /opt/firefox/firefox /usr/bin/firefox
  46. chmod 777 -R /opt/firefox/
  47. echo "[Desktop Entry]" > /usr/share/applications/firefox.desktop
  48. echo "Encoding=UTF-8" >> /usr/share/applications/firefox.desktop
  49. echo "Name=Mozilla Firefox" >> /usr/share/applications/firefox.desktop
  50. echo "Comment=Browse the World Wide Web" >> /usr/share/applications/firefox.desktop
  51. echo "GenericName=Web Browser" >> /usr/share/applications/firefox.desktop
  52. echo "X-GNOME-FullName=Mozilla Firefox" >> /usr/share/applications/firefox.desktop
  53. echo "Exec=firefox %u" >> /usr/share/applications/firefox.desktop
  54. echo "Terminal=false" >> /usr/share/applications/firefox.desktop
  55. echo "X-MultipleArgs=false" >> /usr/share/applications/firefox.desktop
  56. echo "Type=Application" >> /usr/share/applications/firefox.desktop
  57. echo "Icon=/opt/firefox/browser/icons/mozicon128.png" >> /usr/share/applications/firefox.desktop
  58. echo "Categories=Network;WebBrowser;" >> /usr/share/applications/firefox.desktop
  59. echo "MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;" >> /usr/share/applications/firefox.desktop
  60. echo "StartupWMClass=Firefox-bin" >> /usr/share/applications/firefox.desktop
  61. echo "StartupNotify=true" >> /usr/share/applications/firefox.desktop
  62. rm -rf /tmp/firefox-$VERSION.tar.bz2
  63. echo " <-Finished->"
  64. ;;
  65. n)
  66. exit
  67. ;;
  68. *)
  69. exit
  70. esac

comments powered by Disqus