summaryrefslogtreecommitdiff
path: root/templates/restart/dns/forwarding
diff options
context:
space:
mode:
Diffstat (limited to 'templates/restart/dns/forwarding')
-rw-r--r--templates/restart/dns/forwarding/node.def15
1 files changed, 9 insertions, 6 deletions
diff --git a/templates/restart/dns/forwarding/node.def b/templates/restart/dns/forwarding/node.def
index b66ab3c..5740ebf 100644
--- a/templates/restart/dns/forwarding/node.def
+++ b/templates/restart/dns/forwarding/node.def
@@ -1,9 +1,12 @@
help: Restart DNS forwarding
run:
- echo "Restarting DNS forwarding..."
- sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --restart-dnsforwarding;
- if [[ $? -eq 0 ]]; then
- echo "Success!"
- fi
-
+ if cli-shell-api existsActive service dns forwarding; then
+ echo "Restarting DNS forwarding..."
+ sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --restart-dnsforwarding;
+ if [[ $? -eq 0 ]]; then
+ echo "Success!"
+ fi
+ else
+ echo "DNS forwarding is not configured"
+ fi