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