From 93f7c1c4d0ec76d81f093b2fc966cf56c17b372b Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Mon, 15 Sep 2008 12:06:07 -0700 Subject: change op-mode command 'clear dns forwarding statistics' to 'clear dns forwarding all' --- scripts/vyatta-op-dns-forwarding.pl | 6 +++--- templates/clear/dns/forwarding/all/node.def | 8 ++++++++ templates/clear/dns/forwarding/statistics/node.def | 8 -------- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 templates/clear/dns/forwarding/all/node.def delete mode 100644 templates/clear/dns/forwarding/statistics/node.def diff --git a/scripts/vyatta-op-dns-forwarding.pl b/scripts/vyatta-op-dns-forwarding.pl index 978ed33..24a64e6 100644 --- a/scripts/vyatta-op-dns-forwarding.pl +++ b/scripts/vyatta-op-dns-forwarding.pl @@ -213,10 +213,10 @@ sub print_nameservers { # # main # -my ($clear_cache, $clear_statistics, $show_statistics, $show_nameservers); +my ($clear_cache, $clear_all, $show_statistics, $show_nameservers); GetOptions("clear-cache!" => \$clear_cache, - "clear-statistics!" => \$clear_statistics, + "clear-all!" => \$clear_all, "show-statistics!" => \$show_statistics, "show-nameservers!" => \$show_nameservers); @@ -224,7 +224,7 @@ if (defined $clear_cache) { system("kill -1 `pidof dnsmasq`"); } -if (defined $clear_statistics) { +if (defined $clear_all) { system("/etc/init.d/dnsmasq restart >&/dev/null"); } diff --git a/templates/clear/dns/forwarding/all/node.def b/templates/clear/dns/forwarding/all/node.def new file mode 100644 index 0000000..b439b78 --- /dev/null +++ b/templates/clear/dns/forwarding/all/node.def @@ -0,0 +1,8 @@ +help: Clear DNS forwarding cache and counters +run: + if ps ax | grep dnsmasq | grep -v grep > /dev/null + then + sudo /opt/vyatta/bin/sudo-users/vyatta-op-dns-forwarding.pl --clear-all + else + echo "DNS forwarding not configured" + fi diff --git a/templates/clear/dns/forwarding/statistics/node.def b/templates/clear/dns/forwarding/statistics/node.def deleted file mode 100644 index 6441e12..0000000 --- a/templates/clear/dns/forwarding/statistics/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Clear DNS forwarding statistics -run: - if ps ax | grep dnsmasq | grep -v grep > /dev/null - then - sudo /opt/vyatta/bin/sudo-users/vyatta-op-dns-forwarding.pl --clear-statistics - else - echo "DNS forwarding not configured" - fi -- cgit v1.2.3