diff options
Diffstat (limited to 'scripts/vyatta-update-dst-nat.pl')
-rwxr-xr-x | scripts/vyatta-update-dst-nat.pl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/vyatta-update-dst-nat.pl b/scripts/vyatta-update-dst-nat.pl index 4a2fb9a..5b8f329 100755 --- a/scripts/vyatta-update-dst-nat.pl +++ b/scripts/vyatta-update-dst-nat.pl @@ -40,7 +40,19 @@ sub raw_cleanup { ipt_disable_conntrack('iptables', 'NAT_CONNTRACK'); } +my $all_deleted = 1; + my $config = new Vyatta::Config; + +$config->setLevel("nat source rule"); +my %rules_src = $config->listNodeStatus(); +my $rule_src; +for $rule_src (keys %rules_src) { + if ($rules_src{$rule_src} ne "deleted") { + $all_deleted = 0; + } +} + $config->setLevel($CONFIG_LEVEL." rule"); my %rules = $config->listNodeStatus(); my $rule; @@ -69,7 +81,6 @@ system("$IPTABLES -t nat -L -n >& /dev/null"); # we have some nat rule(s). make sure conntrack is enabled. ipt_enable_conntrack('iptables', 'NAT_CONNTRACK'); -my $all_deleted = 1; for $rule (@rule_keys) { print OUT "$rule: $rules{$rule}\n"; my $tmp = `iptables -L -nv --line -t nat`; |