wg-quick: linux: ignore save warnings for iptables-nft
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
8d4e4f3a86
commit
bc8bf54185
|
@ -189,7 +189,7 @@ remove_iptables() {
|
||||||
[[ $line == "*"* || $line == COMMIT || $line == "-A "*"-m comment --comment \"wg-quick(8) rule for $INTERFACE\""* ]] || continue
|
[[ $line == "*"* || $line == COMMIT || $line == "-A "*"-m comment --comment \"wg-quick(8) rule for $INTERFACE\""* ]] || continue
|
||||||
[[ $line == "-A"* ]] && found=1
|
[[ $line == "-A"* ]] && found=1
|
||||||
printf -v restore '%s%s\n' "$restore" "${line/#-A/-D}"
|
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
|
[[ $found -ne 1 ]] || echo -n "$restore" | cmd $iptables-restore -n
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue