2024-10-28 06:32:24 +00:00
|
|
|
# this script is an example describing how to run tpws on a custom port
|
|
|
|
|
2024-10-12 18:28:51 +00:00
|
|
|
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
|
2024-10-28 06:32:24 +00:00
|
|
|
|
|
|
|
zapret_custom_daemons()
|
|
|
|
{
|
|
|
|
# $1 - 1 - run, 0 - stop
|
2024-10-12 18:28:51 +00:00
|
|
|
local opt="--user=root --port=$TPPORT_EXTRA_TPWS"
|
2024-10-28 06:32:24 +00:00
|
|
|
tpws_apply_binds opt
|
2024-10-12 18:28:51 +00:00
|
|
|
opt="$opt $TPWS_OPT_EXTRA"
|
2024-10-28 06:32:24 +00:00
|
|
|
filter_apply_hostlist_target opt
|
2024-10-12 18:28:51 +00:00
|
|
|
filter_apply_suffix opt "$TPWS_OPT_SUFFIX_EXTRA"
|
|
|
|
do_daemon $1 $DNUM_EXTRA_TPWS "$TPWS" "$opt"
|
2024-10-28 06:32:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# custom firewall functions echo rules for zapret-v4 and zapret-v6 anchors
|
|
|
|
# they come after automated table definitions. so you can use <zapret> <zapret6> <zapret-user> ...
|
|
|
|
|
|
|
|
zapret_custom_firewall_v4()
|
|
|
|
{
|
2024-10-12 18:28:51 +00:00
|
|
|
pf_anchor_zapret_v4_tpws $TPPORT_EXTRA_TPWS $(replace_char - : $DPORTS_EXTRA)
|
2024-10-28 06:32:24 +00:00
|
|
|
}
|
|
|
|
zapret_custom_firewall_v6()
|
|
|
|
{
|
2024-10-12 18:28:51 +00:00
|
|
|
pf_anchor_zapret_v6_tpws $TPPORT_EXTRA_TPWS $(replace_char - : $DPORTS_EXTRA)
|
2024-10-28 06:32:24 +00:00
|
|
|
}
|