summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2008-02-22 15:47:34 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2008-02-22 15:47:34 -0800
commitc9294916b253c0a940fa5206d116c58c6556a817 (patch)
tree877979a3c16f041a78884c6f74321bbeee76283e
parent0d1bc4bc9d33d163a9482e7c6567f3cd94a99507 (diff)
downloadvyatta-nat-c9294916b253c0a940fa5206d116c58c6556a817.tar.gz
vyatta-nat-c9294916b253c0a940fa5206d116c58c6556a817.zip
fix clear commands for operator level
-rw-r--r--Makefile.am1
-rwxr-xr-xscripts/vyatta-clear-nat4
-rwxr-xr-xscripts/vyatta-update-nat.pl6
-rw-r--r--templates-op/clear/nat/counters/node.def2
-rw-r--r--templates-op/clear/nat/translations/node.def2
5 files changed, 7 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index 143eae3..231fdca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,7 @@ curverdir = $(sysconfdir)/config-migrate/current
sbin_SCRIPTS = scripts/vyatta-update-nat.pl
bin_sudo_users_SCRIPTS = scripts/vyatta-show-nat.pl
+bin_sudo_users_SCRIPTS += scripts/vyatta-clear-nat
share_perl5_DATA = scripts/VyattaNatRule.pm
curver_DATA = cfg-version/nat@2
diff --git a/scripts/vyatta-clear-nat b/scripts/vyatta-clear-nat
new file mode 100755
index 0000000..ffa021d
--- /dev/null
+++ b/scripts/vyatta-clear-nat
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+iptables-save -t nat | iptables-restore
+
diff --git a/scripts/vyatta-update-nat.pl b/scripts/vyatta-update-nat.pl
index 19255ed..acfc0b8 100755
--- a/scripts/vyatta-update-nat.pl
+++ b/scripts/vyatta-update-nat.pl
@@ -24,12 +24,6 @@ sub raw_cleanup {
}
}
-# for "clear nat translations"
-if ($ARGV[0] eq "clearnattranslations") {
- system("iptables-save -t nat | iptables-restore");
- exit 0;
-}
-
my $config = new VyattaConfig;
$config->setLevel("service nat rule");
my %rules = $config->listNodeStatus();
diff --git a/templates-op/clear/nat/counters/node.def b/templates-op/clear/nat/counters/node.def
index 39a6ed5..a887962 100644
--- a/templates-op/clear/nat/counters/node.def
+++ b/templates-op/clear/nat/counters/node.def
@@ -1,2 +1,2 @@
help: Clear NAT counters
-run: sudo iptables -Z -t nat
+run: sudo ${vyatta_bindir}/sudo-users/iptables -Z -t nat
diff --git a/templates-op/clear/nat/translations/node.def b/templates-op/clear/nat/translations/node.def
index 0727cbd..b096905 100644
--- a/templates-op/clear/nat/translations/node.def
+++ b/templates-op/clear/nat/translations/node.def
@@ -1,2 +1,2 @@
help: Clear NAT translations
-run: sudo ${vyatta_sbindir}/vyatta-update-nat.pl clearnattranslations
+run: sudo ${vyatta_bindir}/sudo-users/vyatta-clear-nat