]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/firewall/rules.pl
rules.pl: Add function to check if given firewall chain exists.
[ipfire-2.x.git] / config / firewall / rules.pl
index c12e8fa6e4d38f89f4b44482e646680482fd7acd..1bd2920591baa0cca7cb71f1bc78c9d9ecb5597e 100644 (file)
@@ -976,6 +976,14 @@ sub firewall_is_in_subnet {
        return 0;
 }
 
+sub firewall_chain_exists ($) {
+       my ($chain) = @_;
+
+       my $ret = &General::system("iptables", "--wait", "-n", "-L", "$chain");
+
+       return $ret;
+}
+
 sub ipset_get_sets () {
        my @sets;