mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 04:40:34 +03:00
Rename all directories
This commit is contained in:
33
zapret2/restore-def-cfg.sh
Executable file
33
zapret2/restore-def-cfg.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 remittor
|
||||
|
||||
. /opt/zapret2/comfunc.sh
|
||||
|
||||
cfg_run_on_boot="$( uci -q get $ZAPRET_CFG_NAME.config.run_on_boot )"
|
||||
|
||||
opt_flags=${1:--}
|
||||
opt_strat=$2
|
||||
|
||||
if echo "$opt_flags" | grep -q "(reset_ipset)"; then
|
||||
restore_all_ipset_cfg
|
||||
fi
|
||||
|
||||
create_default_cfg "$opt_flags" "$opt_strat"
|
||||
|
||||
if [ "$cfg_run_on_boot" = "1" ]; then
|
||||
uci set $ZAPRET_CFG_NAME.config.run_on_boot=1
|
||||
uci commit
|
||||
fi
|
||||
|
||||
ZAPRET_SYNC_CONFIG=0
|
||||
if [ "$opt_flags" = "sync" ]; then
|
||||
ZAPRET_SYNC_CONFIG=1
|
||||
fi
|
||||
if echo "$opt_flags" | grep -q "(sync)"; then
|
||||
ZAPRET_SYNC_CONFIG=1
|
||||
fi
|
||||
|
||||
if [ "$ZAPRET_SYNC_CONFIG" = "1" ]; then
|
||||
# renew main config
|
||||
/opt/zapret2/sync_config.sh
|
||||
fi
|
||||
Reference in New Issue
Block a user