Rename all directories

This commit is contained in:
remittor
2025-12-28 20:15:29 +03:00
parent dd35b5d50a
commit c11ca1ca2e
31 changed files with 0 additions and 0 deletions

33
zapret2/restore-def-cfg.sh Executable file
View 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