Page 2 of 19 FirstFirst 123412 ... LastLast
Results 11 to 20 of 183

Thread: Firefox Installation Script Development Thread

  1. #11
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,063
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    made another addition to the script - a verification of the gpg key for the firefox tarball. always good to check integrity of the download.

    also added a -f flag to rm, for good measure.

    anyway, here is the updated script:
    Code:
    #!/bin/bash
    check_exit_status () {
      if [ $? -ne 0 ]; then
        echo "Previous command did not complete successfully."
        exit 1
      fi
    }
    
    echo -e "Updating repositories list\n"
    sudo apt-get update
    check_exit_status
    
    echo -e "\nMaking sure libstdc++5 and the old Firefox are installed\n"
    sudo apt-get -y install firefox libstdc++5
    check_exit_status
    
    echo -e "\nBacking up old Firefox preferences\n"
    cp -R ~/.mozilla ~/.mozilla_backup
    check_exit_status
    
    echo -e "\nChanging to home directory\n"
    cd
    check_exit_status
    
    echo -e "\nDownloading Firefox from the Mozilla site\n"
    wget -c http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.3/linux-i686/en-US/firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nDownloading Firefox signature from the Mozilla site\n"
    wget -c http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.3/linux-i686/en-US/firefox-1.5.0.3.tar.gz.asc
    check_exit_status
    
    echo -e "\nImporting Mozilla Software Releases public key\n"
    gpg --keyserver subkeys.pgp.net --recv 1AF32821
    check_exit_status
    
    echo -e "\nVerifying signature\n"
    gpg --verify firefox-1.5.0.3.tar.gz.asc firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nUnzipping the .tar.gz file\n"
    sudo tar -C /opt -x -z -v -f firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nRemoving the unzipped .tar.gz\n"
    rm -f firefox-1.5.0.3.tar.gz firefox-1.5.0.3.tar.gz.asc
    check_exit_status
    
    echo -e "\nLinking plugins\n"
    cd /opt/firefox/plugins/
    sudo ln -s /usr/lib/mozilla-firefox/plugins/* .
    check_exit_status
    
    echo -e "\nLinking launcher to new Firefox\n"
    sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
    check_exit_status
    sudo ln -s /opt/firefox/firefox /usr/bin/firefox
    check_exit_status
    sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
    check_exit_status
    sudo ln -s /opt/firefox/firefox /usr/bin/mozilla-firefox
    check_exit_status
    
    echo -e "\nThe new Firefox has been installed successfully."
    
    exit

  2. #12
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Okay, I've got the first bug.

    I tested it on a fresh Breezy Ubuntu, and it exits because it cannot backup the non-existent /home/username/.mozilla folder when it's trying to back up the existing profile.

    Since it's a fresh install, there is no .mozilla folder. I don't think this should make the script stop. It should produce and error and then just keep proceeding.

    Another thing--as far as I can tell, Breezy uses /usr/lib/mozilla-firefox/plugins for plugins, but Dapper uses /usr/lib/firefox/plugins.

    So, if the script gets updated for Dapper, that line should be changed.

  3. #13
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,063
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    hmm, ok, well, here is the new script, addressing both concerns:

    Code:
    #!/bin/bash
    check_exit_status () {
      if [ $? -ne 0 ]; then
        echo "Previous command did not complete successfully."
        exit 1
      fi
    }
    
    if grep -q "Breezy" /etc/issue ; then
      PLUGINPATH=/usr/lib/mozilla-firefox/plugins
    elif grep -q "Dapper" /etc/issue ; then
      PLUGINPATH=/usr/lib/firefox/plugins
    else
      echo "This script only works on Breezy or Dapper."
      exit 1
    fi
    
    echo -e "Updating repositories list\n"
    sudo apt-get update
    check_exit_status
    
    echo -e "\nMaking sure libstdc++5 and the old Firefox are installed\n"
    sudo apt-get -y install firefox libstdc++5
    check_exit_status
    
    if [ -d ~/.mozilla ]; then
      echo -e "\nBacking up old Firefox preferences\n"
      cp -R ~/.mozilla ~/.mozilla_backup
      check_exit_status
    else
      echo -e "\nOld firefox preferences not found. Nothing to back up. Proceeding with installation.\n"
    fi
    
    echo -e "\nChanging to home directory\n"
    cd
    check_exit_status
    
    echo -e "\nDownloading Firefox from the Mozilla site\n"
    wget -c http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.3/linux-i686/en-US/firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nDownloading Firefox signature from the Mozilla site\n"
    wget -c http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.3/linux-i686/en-US/firefox-1.5.0.3.tar.gz.asc
    check_exit_status
    
    echo -e "\nImporting Mozilla Software Releases public key\n"
    gpg --keyserver subkeys.pgp.net --recv 1AF32821
    check_exit_status
    
    echo -e "\nVerifying signature\n"
    gpg --verify firefox-1.5.0.3.tar.gz.asc firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nUnzipping the .tar.gz file\n"
    sudo tar -C /opt -x -z -v -f firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nRemoving the unzipped .tar.gz\n"
    rm -f firefox-1.5.0.3.tar.gz firefox-1.5.0.3.tar.gz.asc
    check_exit_status
    
    echo -e "\nLinking plugins\n"
    cd /opt/firefox/plugins/
    sudo ln -s $PLUGINPATH/* .
    check_exit_status
    
    echo -e "\nLinking launcher to new Firefox\n"
    sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
    check_exit_status
    sudo ln -s /opt/firefox/firefox /usr/bin/firefox
    check_exit_status
    sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
    check_exit_status
    sudo ln -s /opt/firefox/firefox /usr/bin/mozilla-firefox
    check_exit_status
    
    echo -e "\nThe new Firefox has been installed successfully."
    
    exit
    added a test for ubuntu version, which sets plugin directory accordingly, as well as a test for existence of ~/.mozilla before attempting to copy it (and proceeding if it doesn't exist).

  4. #14
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Whoa! Awesome response time! I'll test the new script out tonight.

    The script is almost perfect, thanks to your hard work.

    The next step to make it perfect would be to have it download the language version of choice and also pick a different mirror if the mirror it's trying to draw from is down.

    That's a big next step, though.

    Let me test out what you've written so far. More later...

  5. #15
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,063
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    Whoa! Awesome response time! I'll test the new script out tonight.

    The script is almost perfect, thanks to your hard work.

    The next step to make it perfect would be to have it download the language version of choice and also pick a different mirror if the mirror it's trying to draw from is down.

    That's a big next step, though.

    Let me test out what you've written so far. More later...
    hmm, well, the choice of language version should be fairly straightforward to code in. i will give it a crack tonight (or maybe tomorrow). so would the choosing of a different mirror in case of failure - if i had a list of mirrors. i kinda thought that the ftp-mozilla.netscape.com automatically passed through the requests to a bunch of mirrors, but maybe i'm wrong?

  6. #16
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by nanotube
    hmm, well, the choice of language version should be fairly straightforward to code in. i will give it a crack tonight (or maybe tomorrow). so would the choosing of a different mirror in case of failure - if i had a list of mirrors. i kinda thought that the ftp-mozilla.netscape.com automatically passed through the requests to a bunch of mirrors, but maybe i'm wrong?
    You know, maybe you should host this--the new script you've created is way beyond me. I think once we finish testing it, you should put it up on your keylogger site, and I'll just link to it from Psychocats.

  7. #17
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,063
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    You know, maybe you should host this--the new script you've created is way beyond me. I think once we finish testing it, you should put it up on your keylogger site, and I'll just link to it from Psychocats.
    it's all the same to me. since you are doing the testing, and since you made the original script, you have just as much claim on this script as i do. so don't worry.

    oh and btw, so do you know about a list of official mirrors for firefox? i looked around on mozilla.org/com, and couldn't find it. only site i've seen is one we download from already...

  8. #18
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by nanotube
    it's all the same to me. since you are doing the testing, and since you made the original script, you have just as much claim on this script as i do. so don't worry.
    That's very funny, nanotube.

    I hardly have any claim to this script. "My" script is basically just
    Code:
    #!/bin/bash
    with the Wiki instructions pasted in one after the other and a wget command.

    Your script is a fully functional script that includes programming and syntax created by you.

    While I would be able to modify my script (and I have) when people have told me about problems with it, your script is way beyond my editing capabilities, so it would be up to you to maintain--thus, it would make sense to host it on your site.

    I will probably post up something like:
    This script has been improved upon and moved. It now lives here [link to your site]. Here are the differences between the new script and the old script [list of changes]. If you still want to use the old script, for whatever strange reason, here it is [link to my script]. Otherwise, please use the new script [link to your script], which is smarter and will be updated as needed.
    oh and btw, so do you know about a list of official mirrors for firefox? i looked around on mozilla.org/com, and couldn't find it. only site i've seen is one we download from already...
    http://www.mozilla.org/mirrors.html

  9. #19
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,063
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    That's very funny, nanotube.

    I hardly have any claim to this script. "My" script is basically just
    Code:
    #!/bin/bash
    with the Wiki instructions pasted in one after the other and a wget command.

    Your script is a fully functional script that includes programming and syntax created by you.

    While I would be able to modify my script (and I have) when people have told me about problems with it, your script is way beyond my editing capabilities, so it would be up to you to maintain--thus, it would make sense to host it on your site.
    oh no, maintenance! what have i gotten myself into???

    still, i think you underplay your contribution - first, you had the initiative and the foresight to actually make a script out of it (i don't see anyone else who did). second, testing is nothing to scoff at, either (it's an important part of any piece of code). neither is #!/bin/bash.

    I will probably post up something like: ...
    well if you insist, sure, that would be fine. i'd still appreciate your testing the script, before we post it up for "general consumption".

    ah, thanks! i notice also that it says "Note: when you connect to ftp.mozilla.org, you are connecting to one of the United States mirrors."
    so we will just change our wgets to go to ftp.mozilla.org, and all the mirroring will be taken care of by load balancing magic. a bunch of US mirrors ought to be good enough, methinks?

  10. #20
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by nanotube
    oh no, maintenance! what have i gotten myself into???
    I think that's a question we all ask ourselves sometimes.

    still, i think you underplay your contribution - first, you had the initiative and the foresight to actually make a script out of it (i don't see anyone else who did). second, testing is nothing to scoff at, either (it's an important part of any piece of code). neither is #!/bin/bash.
    Well, in all fairness, Automatix does install Firefox. I created the script because I wanted something a little less committal. If people had all the plugins they wanted and such, I didn't want to have to tell them "Install Automatix" just to get the latest Firefox, too.

    As with the Add-On CD project (which seems to be in hibernation right now), I'm a big fan of the philosophy, "We need a good way to do X. But if no one is going to do X well, I'll do X terribly just so we'll have it!"

    well if you insist, sure, that would be fine. i'd still appreciate your testing the script, before we post it up for "general consumption".
    I'll do extensive testing in the next 24-hours.

    ah, thanks! i notice also that it says "Note: when you connect to ftp.mozilla.org, you are connecting to one of the United States mirrors."
    so we will just change our wgets to go to ftp.mozilla.org, and all the mirroring will be taken care of by load balancing magic. a bunch of US mirrors ought to be good enough, methinks?
    Cool. I guess you can hold off on the European ones for now. Or, if you get tired of maintaining the project, maybe someone else will take up the reins.
    Last edited by aysiu; May 25th, 2006 at 07:50 PM.

Page 2 of 19 FirstFirst 123412 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •