diff options
-rwxr-xr-x | scripts/yesno | 3 | ||||
-rw-r--r-- | templates/poweroff/at/node.def | 1 | ||||
-rw-r--r-- | templates/poweroff/at/node.tag/node.def (renamed from templates/shutdown/at/node.tag/node.def) | 2 | ||||
-rw-r--r-- | templates/poweroff/cancel/node.def | 2 | ||||
-rw-r--r-- | templates/poweroff/node.def (renamed from templates/shutdown/node.def) | 4 | ||||
-rw-r--r-- | templates/poweroff/now/node.def | 3 | ||||
-rw-r--r-- | templates/shutdown/at/node.def | 1 | ||||
-rw-r--r-- | templates/shutdown/cancel/node.def | 2 |
8 files changed, 12 insertions, 6 deletions
diff --git a/scripts/yesno b/scripts/yesno index 3e10e09..260a23c 100755 --- a/scripts/yesno +++ b/scripts/yesno @@ -4,8 +4,11 @@ default= if [ "$1" = "-y" ] then default='y'; shift +elif [[ "$1" = "-n" ]]; then + default='n'; shift fi + if [ $# -eq 0 ] then prompt="yes or no: " else prompt="$*" diff --git a/templates/poweroff/at/node.def b/templates/poweroff/at/node.def new file mode 100644 index 0000000..537bfff --- /dev/null +++ b/templates/poweroff/at/node.def @@ -0,0 +1 @@ +help: Poweroff at a specific time diff --git a/templates/shutdown/at/node.tag/node.def b/templates/poweroff/at/node.tag/node.def index 3360f88..ccc3b5b 100644 --- a/templates/shutdown/at/node.tag/node.def +++ b/templates/poweroff/at/node.tag/node.def @@ -1,4 +1,4 @@ -help: Shutdown the system at a future time +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 & diff --git a/templates/poweroff/cancel/node.def b/templates/poweroff/cancel/node.def new file mode 100644 index 0000000..c08a72d --- /dev/null +++ b/templates/poweroff/cancel/node.def @@ -0,0 +1,2 @@ +help: Cancel a pending poweroff +run: sudo /sbin/shutdown -c diff --git a/templates/shutdown/node.def b/templates/poweroff/node.def index 81cbc5f..b3a41f1 100644 --- a/templates/shutdown/node.def +++ b/templates/poweroff/node.def @@ -1,9 +1,9 @@ -help: Shutdown the system +help: Poweroff the system run: if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ] then sudo /sbin/shutdown -h now else - ${vyatta_bindir}/yesno -y "Proceed with shutdown? [confirm]" \ + ${vyatta_bindir}/yesno -n "Proceed with poweroff? (Yes/No) [No] " \ && sudo /sbin/shutdown -h now fi diff --git a/templates/poweroff/now/node.def b/templates/poweroff/now/node.def new file mode 100644 index 0000000..1117668 --- /dev/null +++ b/templates/poweroff/now/node.def @@ -0,0 +1,3 @@ +help: Poweroff the system now [disruptive] +run: sudo /sbin/shutdown -h now + diff --git a/templates/shutdown/at/node.def b/templates/shutdown/at/node.def deleted file mode 100644 index baa0023..0000000 --- a/templates/shutdown/at/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Shutdown at a specific time diff --git a/templates/shutdown/cancel/node.def b/templates/shutdown/cancel/node.def deleted file mode 100644 index 3095c66..0000000 --- a/templates/shutdown/cancel/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Cancel a pending shutdown -run: sudo /sbin/shutdown -c |