Skip to content

Commit

Permalink
scripts/action: introduce update toggle enable/disable
Browse files Browse the repository at this point in the history
sh action.sh --toggle-updatejson
  • Loading branch information
backslashxx committed Dec 8, 2024
1 parent 425bf05 commit 4a6962b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ enable_cron() {
fi
}

toggle_updatejson() {
grep -q "^updateJson" $MODDIR/module.prop && {
sed -i 's/updateJson/xpdateJson/g' $MODDIR/module.prop
echo "[x] module updates disabled!"
} || { sed -i 's/xpdateJson/updateJson/g' $MODDIR/module.prop
echo "[+] module updates enabled!"
}
}

adblock() {
# sources
echo "[+] processing sources"
Expand Down Expand Up @@ -201,6 +210,7 @@ case "$1" in
--force-update) run; exit ;;
--force-reset) reset; exit ;;
--enable-cron) enable_cron; exit ;;
--toggle-updatejson) toggle_updatejson; exit ;;
esac

# toggle
Expand Down

0 comments on commit 4a6962b

Please sign in to comment.