mirror of
https://github.com/bol-van/zapret.git
synced 2026-01-31 14:50:42 +03:00
scripts: use ZAPRET_RW and ZAPRET_CONFIG vars
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# init script functions library for macos
|
||||
|
||||
[ -n "$ZAPRET_BASE" ] || ZAPRET_BASE=/opt/zapret
|
||||
. "$ZAPRET_BASE/config"
|
||||
ZAPRET_BASE=${ZAPRET_BASE:-/opt/zapret}
|
||||
ZAPRET_RW=${ZAPRET_RW:-"$ZAPRET_BASE"}
|
||||
ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
||||
. "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_BASE/common/base.sh"
|
||||
. "$ZAPRET_BASE/common/pf.sh"
|
||||
. "$ZAPRET_BASE/common/list.sh"
|
||||
|
||||
@@ -31,7 +31,9 @@ check_need_to_reload_tpws6()
|
||||
else
|
||||
ZAPRET_BASE=/opt/zapret
|
||||
fi
|
||||
. "$ZAPRET_BASE/config"
|
||||
ZAPRET_RW=${ZAPRET_RW:-"$ZAPRET_BASE"}
|
||||
ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
||||
. "$ZAPRET_CONFIG"
|
||||
|
||||
check_need_to_reload_tpws6
|
||||
[ -n "$RELOAD_TPWS6" ] && {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
. /lib/functions/network.sh
|
||||
|
||||
[ -n "$ZAPRET_BASE" ] || ZAPRET_BASE=/opt/zapret
|
||||
. "$ZAPRET_BASE/config"
|
||||
ZAPRET_BASE=${ZAPRET_BASE:-/opt/zapret}
|
||||
ZAPRET_RW=${ZAPRET_RW:-"$ZAPRET_BASE"}
|
||||
ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
||||
. "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_BASE/common/base.sh"
|
||||
. "$ZAPRET_BASE/common/fwtype.sh"
|
||||
. "$ZAPRET_BASE/common/queue.sh"
|
||||
|
||||
34
init.d/sysv/custom
Executable file
34
init.d/sysv/custom
Executable file
@@ -0,0 +1,34 @@
|
||||
# this script contain your special code to launch daemons and configure firewall
|
||||
# use helpers from "functions" file
|
||||
# in case of upgrade keep this file only, do not modify others
|
||||
|
||||
zapret_custom_daemons()
|
||||
{
|
||||
# $1 - 1 - run, 0 - stop
|
||||
|
||||
# PLACEHOLDER
|
||||
echo !!! NEED ATTENTION !!!
|
||||
echo Start daemon\(s\)
|
||||
echo Study how other sections work
|
||||
|
||||
do_daemon $1 1 /bin/sleep 20
|
||||
}
|
||||
zapret_custom_firewall()
|
||||
{
|
||||
# $1 - 1 - run, 0 - stop
|
||||
|
||||
# PLACEHOLDER
|
||||
echo !!! NEED ATTENTION !!!
|
||||
echo Configure iptables for required actions
|
||||
echo Study how other sections work
|
||||
}
|
||||
|
||||
zapret_custom_firewall_nft()
|
||||
{
|
||||
# stop logic is not required
|
||||
|
||||
# PLACEHOLDER
|
||||
echo !!! NEED ATTENTION !!!
|
||||
echo Configure nftables for required actions
|
||||
echo Study how other sections work
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
# init script functions library for desktop linux systems
|
||||
|
||||
[ -n "$ZAPRET_BASE" ] || ZAPRET_BASE=/opt/zapret
|
||||
. "$ZAPRET_BASE/config"
|
||||
ZAPRET_BASE=${ZAPRET_BASE:-/opt/zapret}
|
||||
ZAPRET_RW=${ZAPRET_RW:-"$ZAPRET_BASE"}
|
||||
ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
||||
. "$ZAPRET_CONFIG"
|
||||
. "$ZAPRET_BASE/common/base.sh"
|
||||
. "$ZAPRET_BASE/common/fwtype.sh"
|
||||
. "$ZAPRET_BASE/common/queue.sh"
|
||||
|
||||
Reference in New Issue
Block a user