mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-24 22:32:58 +03:00
init.d: number pools. FW_EXTRA. nft insert. customs reorder
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
# this script is an example describing how to run tpws on a custom port
|
||||
|
||||
DNUM=100
|
||||
TPPORT_MY=${TPPORT_MY:-987}
|
||||
TPWS_OPT_MY=${TPWS_OPT_MY:-987}
|
||||
TPWS_OPT_SUFFIX_MY="${TPWS_OPT_SUFFIX_MY:-}"
|
||||
DPORTS_MY=${DPORTS_MY:-20443,20444,30000-30009}
|
||||
TPWS_OPT_EXTRA=${TPWS_OPT_EXTRA:---split-pos=2}
|
||||
TPWS_OPT_SUFFIX_EXTRA="${TPWS_OPT_SUFFIX_EXTRA:-}"
|
||||
DPORTS_EXTRA=${DPORTS_EXTRA:-20443,20444,30000-30009}
|
||||
|
||||
alloc_dnum DNUM_EXTRA_TPWS
|
||||
alloc_tpws_port TPPORT_EXTRA_TPWS
|
||||
|
||||
zapret_custom_daemons()
|
||||
{
|
||||
# $1 - 1 - run, 0 - stop
|
||||
local opt="--user=root --port=$TPPORT_MY"
|
||||
local opt="--user=root --port=$TPPORT_EXTRA_TPWS"
|
||||
tpws_apply_binds opt
|
||||
opt="$opt $TPWS_OPT_MY"
|
||||
opt="$opt $TPWS_OPT_EXTRA"
|
||||
filter_apply_hostlist_target opt
|
||||
filter_apply_suffix opt "$TPWS_OPT_SUFFIX_MY"
|
||||
do_daemon $1 $DNUM "$TPWS" "$opt"
|
||||
filter_apply_suffix opt "$TPWS_OPT_SUFFIX_EXTRA"
|
||||
do_daemon $1 $DNUM_EXTRA_TPWS "$TPWS" "$opt"
|
||||
}
|
||||
|
||||
# custom firewall functions echo rules for zapret-v4 and zapret-v6 anchors
|
||||
@@ -22,9 +23,9 @@ zapret_custom_daemons()
|
||||
|
||||
zapret_custom_firewall_v4()
|
||||
{
|
||||
pf_anchor_zapret_v4_tpws $TPPORT_MY $(replace_char - : $DPORTS_MY)
|
||||
pf_anchor_zapret_v4_tpws $TPPORT_EXTRA_TPWS $(replace_char - : $DPORTS_EXTRA)
|
||||
}
|
||||
zapret_custom_firewall_v6()
|
||||
{
|
||||
pf_anchor_zapret_v6_tpws $TPPORT_MY $(replace_char - : $DPORTS_MY)
|
||||
pf_anchor_zapret_v6_tpws $TPPORT_EXTRA_TPWS $(replace_char - : $DPORTS_EXTRA)
|
||||
}
|
||||
|
Reference in New Issue
Block a user