summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-01-24 15:01:33 +0000
committerAlex Harpin <development@landsofshadow.co.uk>2015-02-24 21:50:36 +0000
commit5cf3930a0d7155fd7a91ca68eb56d1fa40f093b7 (patch)
treebb81661aa5fe113e3f623dcd69c467d894443d8b /templates
parente7268a72e4589afc732f1927317b7108727d4f60 (diff)
downloadvyatta-op-5cf3930a0d7155fd7a91ca68eb56d1fa40f093b7.tar.gz
vyatta-op-5cf3930a0d7155fd7a91ca68eb56d1fa40f093b7.zip
vyatta-op: update the system poweroff cli command to be script based
Update the system poweroff command to use the vyatta-poweroff.pl script rather than simply uisng the shutdown command. This allows other actions to be taken on shutdown, including correctly disconnecting SSH clients rather than having them resorting to timing out (Bug #298) Bug #460 http://bugzilla.vyos.net/show_bug.cgi?id=460
Diffstat (limited to 'templates')
-rw-r--r--templates/poweroff/at/node.tag/node.def7
-rw-r--r--templates/poweroff/cancel/node.def2
-rw-r--r--templates/poweroff/node.def9
-rw-r--r--templates/poweroff/now/node.def5
4 files changed, 6 insertions, 17 deletions
diff --git a/templates/poweroff/at/node.tag/node.def b/templates/poweroff/at/node.tag/node.def
index ccc3b5b..932e04b 100644
--- a/templates/poweroff/at/node.tag/node.def
+++ b/templates/poweroff/at/node.tag/node.def
@@ -1,6 +1,3 @@
help: Poweroff the system at a future time
-allowed: echo -n '<HH:MM>' '<MMDDYY>' '+MM'
-run: if /opt/vyatta/bin/vyatta-gettime.pl $3 >/tmp/shutdown.at
- then (sudo /sbin/shutdown -h $3 &
- disown %?sudo ) >/dev/null 2>&1
- fi
+allowed: echo -n '<HH:MM>' '<MMDDYY>' '<midnight>' '<noon>'
+run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff_at --at_time "$3"
diff --git a/templates/poweroff/cancel/node.def b/templates/poweroff/cancel/node.def
index c08a72d..c45f17a 100644
--- a/templates/poweroff/cancel/node.def
+++ b/templates/poweroff/cancel/node.def
@@ -1,2 +1,2 @@
help: Cancel a pending poweroff
-run: sudo /sbin/shutdown -c
+run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff_cancel
diff --git a/templates/poweroff/node.def b/templates/poweroff/node.def
index 44b8301..ccb7338 100644
--- a/templates/poweroff/node.def
+++ b/templates/poweroff/node.def
@@ -1,9 +1,2 @@
help: Poweroff the system
-run: if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ]
- then
- sudo /sbin/shutdown -h now && sudo /usr/bin/killall sshd
- else
- ${vyatta_bindir}/yesno -n "Proceed with poweroff? (Yes/No) [No] " \
- && sudo /sbin/shutdown -h now && sudo /usr/bin/killall sshd
- fi
-
+run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff
diff --git a/templates/poweroff/now/node.def b/templates/poweroff/now/node.def
index d9902cb..6b67572 100644
--- a/templates/poweroff/now/node.def
+++ b/templates/poweroff/now/node.def
@@ -1,3 +1,2 @@
-help: Poweroff the system now [disruptive]
-run: sudo /sbin/shutdown -h now && sudo /usr/bin/killall sshd
-
+help: Poweroff the system without confirmation
+run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff --now