Skip to content

Instantly share code, notes, and snippets.

@ToadKing
Last active May 17, 2021 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToadKing/006dd0eaa5f2cdc26b88bfb2d08b0e15 to your computer and use it in GitHub Desktop.
Save ToadKing/006dd0eaa5f2cdc26b88bfb2d08b0e15 to your computer and use it in GitHub Desktop.
#!/bin/sh -e
# source: https://gist.github.com/ToadKing/006dd0eaa5f2cdc26b88bfb2d08b0e15
_name=firefox
_channel=nightly
_lang=en-US
_arch=x86_64
pkgname=${_name}-${_channel}
current_version=$(pacman -Q ${pkgname} | cut -d' ' -f2 | cut -d- -f1)
_version=$(echo ${current_version} | cut -d. -f1,2)
_src="${_name}-${_version}.${_lang}.linux-${_arch}.txt"
_url="https://download-installer.cdn.mozilla.net/pub/${_name}/nightly/latest-mozilla-central/${_src}"
dst=$(mktemp)
trap "rm -f ${dst}" EXIT
curl -s -f ${_url} -o ${dst}
latest_version=$(echo "${_version}.$(head -n1 ${dst})+h$(tail -n1 ${dst} | cut -c 44-55)")
if [ "X${current_version}" = "X${latest_version}" ] ; then
exit 1
else
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment