Skip to content

Instantly share code, notes, and snippets.

@FaustinM
Created December 19, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FaustinM/2b4fa85692e007855b24769bb4f807ec to your computer and use it in GitHub Desktop.
Save FaustinM/2b4fa85692e007855b24769bb4f807ec to your computer and use it in GitHub Desktop.
Easy update for firefox developper edition !
#!/bin/bash
lastVersion=$(curl -s 'https://product-details.mozilla.org/1.0/firefox_versions.json' | jq -r '.FIREFOX_DEVEDITION')
versionBrut=$(firefox -v)
selector="Mozilla Firefox "
actualVersion=${versionBrut/$selector/""}
sleep 3
if [ "$actualVersion" == "$lastVersion" ]
then
notify-send -i /opt/firefox_dev/browser/chrome/icons/default/default128.png "La dernière mise à jour est déjà présente..."
elif pgrep -x "firefox-bin" > /dev/null
then
echo $(pgrep -x "firefox-bin")
notify-send -i /opt/firefox_dev/browser/chrome/icons/default/default128.png "Erreur lors de la mise à jour" "Firefox est en cours d'execution"
else
wget -O /tmp/firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=fr"
tar -xjf /tmp/firefox.tar.bz2 -C /tmp/
pkexec rm -R /opt/firefox_dev
pkexec cp -r /tmp/firefox/ /opt/firefox_dev
notify-send -i /opt/firefox_dev/browser/chrome/icons/default/default128.png "Firefox est à jour : $lastVersion"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment