Created
December 19, 2019 16:55
-
-
Save FaustinM/2b4fa85692e007855b24769bb4f807ec to your computer and use it in GitHub Desktop.
Easy update for firefox developper edition !
This file contains 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/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