From 4a6962bc0c58255450c7d0425ff56a023886a699 Mon Sep 17 00:00:00 2001 From: backslashxx <118538522+backslashxx@users.noreply.github.com> Date: Sun, 8 Dec 2024 23:24:53 +0800 Subject: [PATCH] scripts/action: introduce update toggle enable/disable sh action.sh --toggle-updatejson --- module/action.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/action.sh b/module/action.sh index 6547662..6df24de 100644 --- a/module/action.sh +++ b/module/action.sh @@ -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" @@ -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