From: Mark Wooding Date: Sat, 23 Jul 2011 11:45:38 +0000 (+0100) Subject: functions.m4: Make clearchain tolerant of existing chains. X-Git-Url: https://git.distorted.org.uk/~mdw/firewall/commitdiff_plain/e91f4bbf73b2117374ce030959f75b7c7d8fae4a functions.m4: Make clearchain tolerant of existing chains. It's a handy way to make chains which are populated elsewhere, e.g., by fail2ban. --- diff --git a/functions.m4 b/functions.m4 index b2e3cb6..fd24364 100644 --- a/functions.m4 +++ b/functions.m4 @@ -85,7 +85,7 @@ clearchain () { *:*) table=${chain%:*} chain=${chain#*:} ;; *) table=filter ;; esac - run ip46tables -t $table -N $chain + run ip46tables -t $table -N $chain 2>/dev/null || : done }