Last active
May 17, 2021 14:21
-
-
Save ToadKing/006dd0eaa5f2cdc26b88bfb2d08b0e15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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