summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <mike@vyatta.com>2011-05-05 10:33:35 -0700
committerMichael Larson <mike@vyatta.com>2011-05-05 10:33:35 -0700
commit7cb0a823196182e7992e043624ad4976c1faa756 (patch)
tree18dfcda22f867b02e3463c9dd73686bae534ff4b
parent2bfa80b1495cea774872c1cc91c76d27af4bf28a (diff)
downloadvyatta-op-7cb0a823196182e7992e043624ad4976c1faa756.tar.gz
vyatta-op-7cb0a823196182e7992e043624ad4976c1faa756.zip
suppress shutdown confirmation query if invoked by rest API.
-rw-r--r--templates/shutdown/node.def10
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/shutdown/node.def b/templates/shutdown/node.def
index 4185f40..81cbc5f 100644
--- a/templates/shutdown/node.def
+++ b/templates/shutdown/node.def
@@ -1,3 +1,9 @@
help: Shutdown the system
-run: ${vyatta_bindir}/yesno -y "Proceed with shutdown? [confirm]" \
- && sudo /sbin/shutdown -h now
+run: if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ]
+ then
+ sudo /sbin/shutdown -h now
+ else
+ ${vyatta_bindir}/yesno -y "Proceed with shutdown? [confirm]" \
+ && sudo /sbin/shutdown -h now
+ fi
+