Linux Installer Point/Nightly

Discussion of general topics about Mozilla Firefox
Post Reply
User avatar
Freyr
Posts: 81
Joined: July 17th, 2004, 11:34 am
Location: Missouri,USA

Linux Installer Point/Nightly

Post by Freyr »

I just update my install script for firefox.This script will install the latest night or the latest point release(1.0PR at the moment).
Please post comments or ideas.The only big programs you need to run this script are wget and tar.

<b> To use the scripts </b>
1.Copy the script and paste into any text editor(nedit,nano,vi,emac,etc).
2.Save the file as a plain text(.txt) to anywhere and with any name but have .sh at the end(aka firefoxscript.sh)
3.Start a terminel as root.then do sh /path/to/script/scriptsname.sh
4.Pick Option 1 or 2 to install.

<b> Firefox 10/02/04 </b>

cleanup () { cd /root/tmp;
echo "Cleaning up download files.";
rm -f /root/tmp/firefox*i686-linux-gtk2+xft.tar.gz
rm -f /root/tmp/wget-log;
echo "Install Complete,Run with the firefox-script command."; }
untar () { clear;echo "Extracting Mozilla Firefox.Please Wait..."
if tar -xzf /root/tmp/firefox*i686-linux-gtk2+xft.tar.gz
then chown -R root:root /root/tmp/firefox;chmod -R a+r /root/tmp/firefox
else echo "Extracting Failed";exit;fi }
backup () { if test -d /opt/mozilla/firefox
then echo "Backing up current install"
rm -dfr /opt/mozilla/firefox.old
mv -f /opt/mozilla/firefox /opt/mozilla/firefox.old;fi }
install () { echo "Installing Mozilla Firefox in /opt/mozilla";
if test ! -d /opt/mozilla
then mkdir /opt/mozilla;fi
mv /root/tmp/firefox /opt/mozilla;
echo /opt/mozilla/firefox/firefox > /usr/bin/firefox-script;
chmod 555 /usr/bin/firefox-script; }
if test -O /root
then cleanup
else echo "Script must be ran by root";exit;fi
until [ "$selection" = "0" ]; do
clear
echo "Mozilla Firefox Install/Update Script 10/02/04
By Freyr
Released under the GNU GPL v2
Option Menu

1 - Install/Update 0.10.1(Official Release)
2 - Install/Update Nightly Aviary(Recommended)
3 - Install/Update Nightly Trunk(Not Recommended)
4 - Restore Backup
5 - Uninstall
0 - Exit Script

Enter selection:"
read selection
clear
case $selection in
1)echo "Downloading Mozilla Firefox with WGet.Please wait...."
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
2)echo "Downloading Mozilla Firefox Aviary with WGet.Please wait...."
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
3)echo "Downloading Mozilla Firefox Trunk with WGet.Please wait...."
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
4)if test -d /opt/mozilla/firefox.old
then rm -dfr /opt/mozilla/firefox
mv -f /opt/mozilla/firefox.old /opt/mozilla/firefox
echo "Restore Complete.";exit
else echo "No Backup to Restore.";exit;fi;;
5)rm -dfr /opt/mozilla/firefox
rm -dfr /opt/mozilla/firefox.old
rm -f /usr/bin/firefox-nightly
echo "Uninstall Complete.";exit;;
0)echo "Script Stopped.";;
*)echo "Please use 1,2,3 or 0";echo "Press Enter to continue";read;;
esac;done


<b>Thunderbird 09/26/04</b>

cleanup () { cd /root/tmp;
echo "Cleaning up download files.";
rm -f /root/tmp/thunderbird-i686-linux-gtk2+xft.tar.gz;
rm -f /root/tmp/thunderbird-0.8-i686-linux-gtk2+xft.tar.gz;
rm -f /root/tmp/wget-log;
echo "Install Complete,Run with the thunderbird-script command."; }
untar () { clear;echo "Extracting Mozilla thunderbird.Please Wait..."
if tar -xzf /root/tmp/thunderbird*i686-linux-gtk2+xft.tar.gz
then chown -R root:root /root/tmp/thunderbird;chmod -R a+r /root/tmp/thunderbird
else echo "Extracting Failed";exit;fi }
backup () { if test -d /opt/mozilla/thunderbird
then echo "Backing up current install"
rm -dfr /opt/mozilla/thunderbird.old
mv -f /opt/mozilla/thunderbird /opt/mozilla/thunderbird.old;fi }
install () { echo "Installing Mozilla Thunderbird in /opt/mozilla";
if test ! -d /opt/mozilla
then mkdir /opt/mozilla;fi
mv /root/tmp/thunderbird /opt/mozilla;
echo /opt/mozilla/thunderbird/thunderbird > /usr/bin/thunderbird-script;
chmod 555 /usr/bin/thunderbird-script; }
if test -O /root
then cleanup
else echo "Script must be ran by root";exit;fi
until [ "$selection" = "0" ]; do
clear
echo "Mozilla Thunderbird Install/Update Script 09/26/04"
echo "By Freyr"
echo "Released under the GNU GPL v2"
echo ""
echo "Option Menu"
echo "1 - Install/Update 0.8"
echo "2 - Install/Update Nightly"
echo "3 - Restore Backup"
echo "4 - Uninstall"
echo "0 - Exit Script"
echo ""
echo "Enter selection:"
read selection
clear
case $selection in
1)echo "Downloading Mozilla Thunderbird 0.8 with WGet.Please wait....";echo ""
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
2)echo "Downloading Mozilla Thunderbird Nightly with WGet.Please wait....";echo ""
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
3)if test -d /opt/mozilla/thunderbird.old
then rm -dfr /opt/mozilla/thunderbird
mv -f /opt/mozilla/thunderbird.old /opt/mozilla/thunderbird
echo "Restore Complete.";exit
else echo "No Backup to Restore.";exit;fi;;
4)rm -dfr /opt/mozilla/thunderbird
rm -dfr /opt/mozilla/thunderbird.old
rm -f /usr/bin/thunderbird-script
echo "Uninstall Complete.";exit;;
0)echo "Script Stopped.";;
*)echo "Please use 1,2,3 or 0";echo "Press Enter to continue";read;;
esac;done

<b>Sunbird 09//26/04</b>

cleanup () { cd /root/tmp;
echo "Cleaning up download files.";
rm -f /tmp/sunbird-i686-linux-gtk2+xft.tar.gz;
rm -f /tmp/wget-log;
echo "Install Complete,Run with the sunbird-script command."; }
untar () { clear;echo "Extracting Mozilla sunbird.Please Wait..."
if tar -xzf /root/tmp/sunbird*i686-linux-gtk2+xft.tar.gz
then chown -R root:root /root/tmp/sunbird;chmod -R a+r /root/tmp/sunbird
else echo "Extracting Failed";exit;fi }
backup () { if test -d /opt/mozilla/sunbird
then echo "Backing up current install"
rm -dfr /opt/mozilla/sunbird.old
mv -f /opt/mozilla/sunbird /opt/mozilla/sunbird.old;fi }
install () { echo "Installing Mozilla sunbird in /opt/mozilla";
if test ! -d /opt/mozilla
then mkdir /opt/mozilla;fi
mv /root/tmp/sunbird /opt/mozilla;
echo /opt/mozilla/sunbird/sunbird > /usr/bin/sunbird-script;
chmod 555 /usr/bin/sunbird-script; }
if test -O /root
then cleanup
else echo "Script must be ran by root";exit;fi
until [ "$selection" = "0" ]; do
clear
echo "Mozilla Sunbird Install/Update Script 09/26/04"
echo "By Freyr"
echo "Released under the GNU GPL v2"
echo ""
echo "Option Menu"
echo "1 - Install/Update Nightly"
echo "2 - Restore Backup"
echo "3 - Uninstall"
echo "0 - Exit Script"
echo ""
echo "Enter selection:"
read selection
clear
case $selection in
1)echo "Downloading Mozilla sunbird Nightly with WGet.Please wait....";echo ""
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
2)if test -d /opt/mozilla/sunbird.old
then rm -dfr /opt/mozilla/sunbird
mv -f /opt/mozilla/sunbird.old /opt/mozilla/sunbird
echo "Restore Complete.";exit
else echo "No Backup to Restore.";exit;fi;;
3)rm -dfr /opt/mozilla/sunbird
rm -dfr /opt/mozilla/sunbird.old
rm -f /usr/bin/sunbird-nightly
echo "Uninstall Complete.";exit;;
0)echo "Script Stopped.";;
*)echo "Please use 1,2,3 or 0";echo "Press Enter to continue";read;;
esac;done
Last edited by Freyr on October 2nd, 2004, 3:36 pm, edited 6 times in total.
User avatar
shevegen666
Posts: 444
Joined: May 12th, 2004, 7:18 am

Post by shevegen666 »

"Please post comments or ideas"

Comment: I LOVE IT
Ideas: Hey can you make a script to install extensions without manually selecting anything?
User avatar
Freyr
Posts: 81
Joined: July 17th, 2004, 11:34 am
Location: Missouri,USA

Post by Freyr »

shevegen666 wrote:"Please post comments or ideas"

Comment: I LOVE IT
Ideas: Hey can you make a script to install extensions without manually selecting anything?


Glad you like the script.I have been tring to do what you want but I can't get anything to work.I don't beleve there is a way for firefox to silently install extensions from the commandline,but the --h is thin on info tho.If there was this would probly be easy.The commandline could look something like this. /opt/mozilla/firefox/firefox -extinstall-silent /path/to/extensions/*.xpi
It would go thru all the extensions in the folder and install them without poping up a window.
User avatar
logan
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403
Contact:

Post by logan »

Use of [code] ... [/code] in a post will save any formatting, keeping it pretty.

Also, use of predictable filenames in /tmp is dangerous. You may want to use ~/tmp or `tempfile' instead.
User avatar
Freyr
Posts: 81
Joined: July 17th, 2004, 11:34 am
Location: Missouri,USA

Post by Freyr »

<b>Use of [code ] ... [/code ] in a post will save any formatting, keeping it pretty. </b>

Using the code thing messes up my script, about 20 lines get cut in half.

<b>Also, use of predictable filenames in /tmp is dangerous. You may want to use ~/tmp or `tempfile' instead.</b>

Could you explain why.I'm just droping downloaded files there to work on them and I clean up the files when I'm done.I moved where I work with files to /root/tmp is that better.
User avatar
logan
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403
Contact:

Post by logan »

Freyr wrote:Could you explain why.I'm just droping downloaded files there to work on them and I clean up the files when I'm done.I moved where I work with files to /root/tmp is that better.

If someone can predict a file in /tmp, they can create a symlink from another file on the system to that, then when you run the script, it's possible to overwrite the other file. If you check <a href="http://www.securityfocus.com/archive/1">bugtraq</a>, you'll see stuff like this crop up now and again.
ln -s /etc/passwd /tmp/firefox-i686-linux-gtk2+xft.tar.gz


Was rm -f /tmp/firefox-yadda.tar.gz always there or did you add that recently? Maybe I missed it before and have just been blabbing on about stuff that doesn't even matter. :P

Also, you could add
test -d /root/tmp || mkdir /root/tmp

just in case someone doesn't have that directory (or just use /root), which they probably won't. 'course I figure most people who use your script will understand what's going on.
User avatar
Freyr
Posts: 81
Joined: July 17th, 2004, 11:34 am
Location: Missouri,USA

Post by Freyr »

If someone can predict a file in /tmp, they can create a symlink from another file on the system to that, then when you run the script, it's possible to overwrite the other file. If you check bugtraq, you'll see stuff like this crop up now and again.

Was rm -f /tmp/firefox-yadda.tar.gz always there or did you add that recently? Maybe I missed it before and have just been blabbing on about stuff that doesn't even matter. Razz

Also, you could add

just in case someone doesn't have that directory (or just use /root), which they probably won't. 'course I figure most people who use your script will understand what's going on.


The remove rm -f /tmp/firefox-yadda.tar.gz was always there at the begining of the script and at end of each install fork.Thanks for telling me about that symlink thing tho,never thought about that before.

I thought a tmp dir in your user dir was normal.XMMS,Xfce,even OpenOffice both put stuff in ~/tmp/ when running.
User avatar
Freyr
Posts: 81
Joined: July 17th, 2004, 11:34 am
Location: Missouri,USA

Post by Freyr »

I updated my script.Was able to make it 20 lines smaller.Tomarrow if I get time i'm going to add a option to install a trunk build.
User avatar
Freyr
Posts: 81
Joined: July 17th, 2004, 11:34 am
Location: Missouri,USA

Post by Freyr »

Mozilla Released a new Offical Version of Firefox.Link updated in the script.I added the nightly trunk as a install option.Trunk is not recommanded for random people to install.It will be outdated compared to Aviery till after 1.0. when they will sync 1.0 and trunk(atleast to my knowledge).Then all new things will be in trunk agian.
Paradexes
Posts: 2
Joined: November 9th, 2004, 1:36 pm

Post by Paradexes »

I have updated the script with the 1.0 official info. I only applied that to the official release. Otherwise I left everything else alone. I really like this script thought I'd help out some in it's maintenance.

cleanup () { cd /root/tmp;
echo "Cleaning up download files.";
rm -f /root/tmp/firefox-1.0.tar.gz
rm -f /root/tmp/wget-log;
echo "Install Complete,Run with the firefox-script command."; }
untar () { clear;echo "Extracting Mozilla Firefox.Please Wait..."
if tar -xzf /root/tmp/firefox-1.0.tar.gz
then chown -R root:root /root/tmp/firefox;chmod -R a+r /root/tmp/firefox
else echo "Extracting Failed";exit;fi }
backup () { if test -d /opt/mozilla/firefox
then echo "Backing up current install"
rm -dfr /opt/mozilla/firefox.old
mv -f /opt/mozilla/firefox /opt/mozilla/firefox.old;fi }
install () { echo "Installing Mozilla Firefox in /opt/mozilla";
if test ! -d /opt/mozilla
then mkdir /opt/mozilla;fi
mv /root/tmp/firefox /opt/mozilla;
echo /opt/mozilla/firefox/firefox > /usr/bin/firefox-script;
chmod 555 /usr/bin/firefox-script; }
if test -O /root
then cleanup
else echo "Script must be ran by root";exit;fi
until [ "$selection" = "0" ]; do
clear
echo "Mozilla Firefox Install/Update Script 10/02/04
By Freyr 1.0 update by Paradexes
Released under the GNU GPL v2
Option Menu

1 - Install/Update1.0 (Official Release)
2 - Install/Update Nightly Aviary(Recommended)
3 - Install/Update Nightly Trunk(Not Recommended)
4 - Restore Backup
5 - Uninstall
0 - Exit Script

Enter selection:"
read selection
clear
case $selection in
1)echo "Downloading Mozilla Firefox with WGet.Please wait...."
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... 1.0.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
2)echo "Downloading Mozilla Firefox Aviary with WGet.Please wait...."
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
3)echo "Downloading Mozilla Firefox Trunk with WGet.Please wait...."
if ! wget http://ftp.mozilla.org/pub/mozilla.org/ ... xft.tar.gz
then echo "Download Failed";exit;fi
untar;backup;install;cleanup;exit;;
4)if test -d /opt/mozilla/firefox.old
then rm -dfr /opt/mozilla/firefox
mv -f /opt/mozilla/firefox.old /opt/mozilla/firefox
echo "Restore Complete.";exit
else echo "No Backup to Restore.";exit;fi;;
5)rm -dfr /opt/mozilla/firefox
rm -dfr /opt/mozilla/firefox.old
rm -f /usr/bin/firefox-nightly
echo "Uninstall Complete.";exit;;
0)echo "Script Stopped.";;
*)echo "Please use 1,2,3 or 0";echo "Press Enter to continue";read;;
esac;done
Post Reply