mirror of https://github.com/bol-van/zapret/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
568 B
29 lines
568 B
zapret_do_firewall()
|
|
{
|
|
linux_fwtype
|
|
|
|
[ "$1" = 1 -a -n "$INIT_FW_PRE_UP_HOOK" ] && $INIT_FW_PRE_UP_HOOK
|
|
[ "$1" = 0 -a -n "$INIT_FW_PRE_DOWN_HOOK" ] && $INIT_FW_PRE_DOWN_HOOK
|
|
|
|
case "$FWTYPE" in
|
|
iptables)
|
|
zapret_do_firewall_ipt "$@"
|
|
;;
|
|
nftables)
|
|
zapret_do_firewall_nft "$@"
|
|
;;
|
|
esac
|
|
|
|
[ "$1" = 1 -a -n "$INIT_FW_POST_UP_HOOK" ] && $INIT_FW_POST_UP_HOOK
|
|
[ "$1" = 0 -a -n "$INIT_FW_POST_DOWN_HOOK" ] && $INIT_FW_POST_DOWN_HOOK
|
|
|
|
return 0
|
|
}
|
|
zapret_apply_firewall()
|
|
{
|
|
zapret_do_firewall 1 "$@"
|
|
}
|
|
zapret_unapply_firewall()
|
|
{
|
|
zapret_do_firewall 0 "$@"
|
|
}
|
|
|