@@ -8,34 +8,38 @@ MOD_PATH="/data/adb/modules/AdGuardHome"
88
99exec >> $AGH_DIR /agh.log 2>&1
1010
11+ update_description () {
12+ sed -i " s/description=\[.*\]/description=\[$1 \]/" " $MOD_PATH /module.prop"
13+ }
14+
1115if [ " ${monitor_file} " = " disable" ]; then
1216 if [ " ${events} " = " d" ]; then
1317 $SCRIPT_DIR /service.sh start
1418 if [ ! -f " /data/adb/modules/AdGuardHome/disable_iptable" ]; then
1519 $SCRIPT_DIR /iptables.sh enable
16- sed -i " s/description=\[.*\]/description=\[😎 AdGuardHome is running and 🔗 iptables is enabled\]/ " " $MOD_PATH /module.prop "
20+ update_description " 🟢 AdGuardHome is running | iptables is enabled"
1721 else
18- sed -i " s/description=\[.*\]/description=\[😎 AdGuardHome is running but ⛓️💥 iptables is disabled\]/ " " $MOD_PATH /module.prop "
22+ update_description " 🟢 AdGuardHome is running | iptables is disabled"
1923 fi
2024 elif [ " ${events} " = " n" ]; then
2125 if [ ! -f " /data/adb/modules/AdGuardHome/disable_iptable" ]; then
2226 $SCRIPT_DIR /iptables.sh disable
2327 fi
2428 $SCRIPT_DIR /service.sh stop
25- sed -i " s/description=\[.*\]/description=\[😐 AdGuardHome is stopped and ⛓️💥iptables is disabled\]/ " " $MOD_PATH /module.prop "
29+ update_description " 🔴 AdGuardHome is stopped"
2630 fi
2731fi
2832
2933if [ " ${monitor_file} " = " disable_iptable" ]; then
3034 if [ " ${events} " = " d" ]; then
3135 if [ ! -f " /data/adb/modules/AdGuardHome/disable" ]; then
3236 $SCRIPT_DIR /iptables.sh enable
33- sed -i " s/description=\[.*\]/description=\[😎 AdGuardHome is running and 🔗 iptables is enabled\]/ " " $MOD_PATH /module.prop "
37+ update_description " 🟢 AdGuardHome is running | iptables is enabled"
3438 fi
3539 elif [ " ${events} " = " n" ]; then
3640 if [ ! -f " /data/adb/modules/AdGuardHome/disable" ]; then
3741 $SCRIPT_DIR /iptables.sh disable
38- sed -i " s/description=\[.*\]/description=\[😎 AdGuardHome is running but ⛓️💥 iptables is disabled\]/ " " $MOD_PATH /module.prop "
42+ update_description " 🟢 AdGuardHome is running | iptables is disabled"
3943 fi
4044 fi
4145fi
0 commit comments