bin sh URL ftp ftp mozilla org pub firefox releases latest linux-i686

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh
URL="ftp://ftp.mozilla.org/pub/firefox/releases/latest/linux-i686/en-US/"
UPSTREAM_VERSION="$(curl --silent --list-only $URL |
sed -nr 's,^firefox-([0-9]+(\.[0-9]+)*)\.tar.bz2$,\1,p')"
CURRENT_VERSION="$(firefox --version |
sed -nr 's/^Mozilla Iceweasel ([0-9]+(\.[0-9]+)*),.*$/\1/p')"
if dpkg --compare-versions "$CURRENT_VERSION" lt "$UPSTREAM_VERSION";
then
echo "Detected a new version -- Firefox $UPSTREAM_VERSION"
curl --silent "$URL/firefox-$UPSTREAM_VERSION.tar.bz2" \
--output "firefox-$UPSTREAM_VERSION.tar.bz2"
else
echo "You are using the latest version of Firefox"
fi
exit 0