blockcheck: simplify

This commit is contained in:
bol-van 2022-01-11 00:31:08 +03:00
parent d746805aec
commit 0cf17165d7

View File

@ -122,11 +122,9 @@ ipt6_has_raw()
ipt_has_nfq()
{
# cannot just check /proc/net/ip_tables_targets because of iptables-nft or modules not loaded yet
local ret ipt
local ipt
for ipt in iptables ip6tables; do
$ipt -A OUTPUT -t mangle -p 255 -j NFQUEUE --queue-num $QNUM --queue-bypass 2>/dev/null
ret=$?
[ $ret = 0 ] || return 1
$ipt -A OUTPUT -t mangle -p 255 -j NFQUEUE --queue-num $QNUM --queue-bypass 2>/dev/null || return 1
$ipt -D OUTPUT -t mangle -p 255 -j NFQUEUE --queue-num $QNUM --queue-bypass 2>/dev/null
done
return 0