From c620e1128d8c6a48d74467e671575c1c55b3a608 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Sat, 30 Aug 2008 07:52:40 +0000 Subject: add command 'clear dns forwarding process' to restart dnsmasq and clear all statistics --- scripts/vyatta-op-dns-forwarding.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vyatta-op-dns-forwarding.pl b/scripts/vyatta-op-dns-forwarding.pl index c53c7a0..6ef8ebb 100644 --- a/scripts/vyatta-op-dns-forwarding.pl +++ b/scripts/vyatta-op-dns-forwarding.pl @@ -213,9 +213,10 @@ sub print_nameservers { # # main # -my ($clear_cache, $show_statistics, $show_nameservers); +my ($clear_cache, $clear_process, $show_statistics, $show_nameservers); GetOptions("clear-cache!" => \$clear_cache, + "clear-process!" => \$clear_process, "show-statistics!" => \$show_statistics, "show-nameservers!" => \$show_nameservers); @@ -223,6 +224,10 @@ if (defined $clear_cache) { system("kill -1 `pidof dnsmasq`"); } +if (defined $clear_process) { + system("/etc/init.d/dnsmasq restart >&/dev/null"); +} + if (defined $show_statistics) { system("echo > /var/log/dnsmasq.log; kill -10 `pidof dnsmasq`"); get_cache_stats; -- cgit v1.2.3