1
0
Fork 0

only update user.js if there is a new arkenfox

This commit is contained in:
Luca Bilke 2023-07-17 13:49:34 +02:00
parent 7bfad45303
commit 50035ee2f2
1 changed files with 8 additions and 2 deletions

View File

@ -18,8 +18,14 @@ command -v apt 1>/dev/null 2>&1 && sudo apt upgrade
command -v xbps-install 1>/dev/null 2>&1 && sudo xbps-install -Syu && pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
printf "%b" "$BOLD${BLUE}Updating arkenfox...$NC\n"
"$DOTS_DIR/.local/share/firefox/updater.sh" -b
newversion=$(grep -oP '(?<=\* version: )\d\d\d' "$(DISPLAY=invalid "$DOTS_DIR"/.local/share/firefox/updater.sh -r 2>/dev/null | grep -oP '(?<=Warning: user.js was saved to temporary file )/tmp/tmp\.\w+\.js')")
oldversion=$(grep -oP '(?<=\* version: )\d\d\d' "$DOTS_DIR"/.local/share/firefox/user.js)
if [ $newversion -gt $oldversion ]; then
printf "%b" "$BOLD${BLUE}Updating arkenfox...$NC\n"
"$DOTS_DIR/.local/share/firefox/updater.sh" -b
fi
printf "%b" "$BOLD${BLUE}Upgrade complete.\nPress <Enter> to exit window.\n"
read -r _