Skip to content

Instantly share code, notes, and snippets.

@boltronics
Created December 28, 2023 09:08
Show Gist options
  • Save boltronics/dfdb51e5cd99a7a8800e3ee219479128 to your computer and use it in GitHub Desktop.
Save boltronics/dfdb51e5cd99a7a8800e3ee219479128 to your computer and use it in GitHub Desktop.
Print the current version number of Firefox for Desktop.
#!/bin/sh
# Print the current version number of Firefox for Desktop.
FIREFOX_RELEASE_FOLDER_URL='https://download-installer.cdn.mozilla.net/pub/firefox/releases/'
get_current_firefox_ver()
{
elinks -dump 1 -no-numbering "${FIREFOX_RELEASE_FOLDER_URL}" |
grep -E '^ \. ' |
sed 's/^ \. //' |
grep '/[0-9]\+\(\.[0-9]\+\)\{1,2\}/' |
sed 's/.*\/releases\/\(.*\)\//\1/' |
sort -V |
tail -n 1
}
get_current_firefox_ver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment