Skip to content

Instantly share code, notes, and snippets.

@rinrinne
Created August 14, 2012 04:56
Show Gist options
  • Save rinrinne/3346386 to your computer and use it in GitHub Desktop.
Save rinrinne/3346386 to your computer and use it in GitHub Desktop.
Update xulrunner for Ubuntu
#!/bin/sh
if [ `id -u` -ne 0 ]; then
echo This command should be run as root.
exit 1
fi
XROOT=/opt/xulrunner
FFVER=$(perl -F/=/ -ane "print \$F[1] if \$F[0] eq 'Milestone'" /usr/lib/firefox/platform.ini)
ARCH=`uname -p`
XURL=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$FFVER/runtimes/xulrunner-$FFVER.en-US.linux-$ARCH.tar.bz2
if [ -d $XROOT/$FFVER ]; then
echo xulrunner-$FFVER is up to date.
exit 0
fi
mkdir -p $XROOT/$FFVER
cd $XROOT/$FFVER
sh -c "wget -O- $XURL | tar -xj"
if [ $? -eq 0 ]; then
ln -snf /opt/xulrunner/$FFVER/xulrunner/xulrunner /usr/bin/xulrunner
ln -snf /opt/xulrunner/$FFVER/xulrunner/xpcshell /usr/bin/xpcshell
echo Finished.
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment