diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rwxr-xr-x | scripts/vyatta-clear-nat | 4 | ||||
-rwxr-xr-x | scripts/vyatta-update-nat.pl | 6 | ||||
-rw-r--r-- | templates-op/clear/nat/counters/node.def | 2 | ||||
-rw-r--r-- | templates-op/clear/nat/translations/node.def | 2 |
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 |