zapret: Global use of dynamic variables

This commit is contained in:
remittor
2025-12-29 21:09:35 +03:00
parent 1d2d3c4b84
commit a3c256c31a
7 changed files with 120 additions and 57 deletions

View File

@@ -1,9 +1,11 @@
#!/bin/sh
# Copyright (c) 2024 remittor
. /opt/zapret/comfunc.sh
EXE_DIR=$(cd "$(dirname "$0")" 2>/dev/null || exit 1; pwd)
cfg_run_on_boot="$( uci -q get zapret.config.run_on_boot )"
. $EXE_DIR/comfunc.sh
cfg_run_on_boot="$( uci -q get $ZAPRET_CFG_SEC.run_on_boot )"
opt_flags=${1:--}
opt_strat=$2
@@ -15,7 +17,7 @@ fi
create_default_cfg "$opt_flags" "$opt_strat"
if [ "$cfg_run_on_boot" = "1" ]; then
uci set zapret.config.run_on_boot=1
uci set $ZAPRET_CFG_SEC.run_on_boot=1
uci commit
fi
@@ -29,5 +31,5 @@ fi
if [ "$ZAPRET_SYNC_CONFIG" = "1" ]; then
# renew main config
/opt/zapret/sync_config.sh
$ZAPRET_BASE/sync_config.sh
fi