From: Jason A. Donenfeld Date: Fri, 6 Dec 2019 15:51:05 +0000 (+0100) Subject: wg-quick: linux: ignore save warnings for iptables-nft X-Git-Tag: v1.0.20191226~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc8bf541854a79cdd83be20d630451a418797299;p=thirdparty%2Fwireguard-tools.git wg-quick: linux: ignore save warnings for iptables-nft Signed-off-by: Jason A. Donenfeld --- diff --git a/src/wg-quick/linux.bash b/src/wg-quick/linux.bash index 4e1f8ee..9bfeed1 100755 --- a/src/wg-quick/linux.bash +++ b/src/wg-quick/linux.bash @@ -189,7 +189,7 @@ remove_iptables() { [[ $line == "*"* || $line == COMMIT || $line == "-A "*"-m comment --comment \"wg-quick(8) rule for $INTERFACE\""* ]] || continue [[ $line == "-A"* ]] && found=1 printf -v restore '%s%s\n' "$restore" "${line/#-A/-D}" - done < <($iptables-save) + done < <($iptables-save 2>/dev/null) [[ $found -ne 1 ]] || echo -n "$restore" | cmd $iptables-restore -n done }