From 0cf17165d7556b471d6e4c3d76c5f5b57a531e5c Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 11 Jan 2022 00:31:08 +0300 Subject: [PATCH] blockcheck: simplify --- blockcheck.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/blockcheck.sh b/blockcheck.sh index 831843d..8387a55 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -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