shutdown/shutdown.sh: reboot, if no argument was given

master
Harald Hoyer 2012-09-27 12:10:14 +02:00
parent a0be1eddcf
commit d65638dacb
1 changed files with 10 additions and 7 deletions

View File

@ -6,6 +6,7 @@
# #
# Copyright 2011, Red Hat, Inc. # Copyright 2011, Red Hat, Inc.
# Harald Hoyer <harald@redhat.com> # Harald Hoyer <harald@redhat.com>
ACTION="$1"


export TERM=linux export TERM=linux
export PATH=/usr/sbin:/usr/bin:/sbin:/bin export PATH=/usr/sbin:/usr/bin:/sbin:/bin
@ -49,14 +50,16 @@ _check_shutdown() {
return $__s return $__s
} }


_cnt=0
while _check_shutdown; do while _check_shutdown; do
: :
done done
_check_shutdown final _check_shutdown final


getarg 'rd.break=shutdown' && emergency_shell --shutdown shutdown "Break before shutdown" getarg 'rd.break=shutdown' && emergency_shell --shutdown shutdown "Break before shutdown"
[ "$1" = "reboot" ] && reboot -f -d -n [ "$ACTION" = "reboot" ] && reboot -f -d -n
[ "$1" = "poweroff" ] && poweroff -f -d -n [ "$ACTION" = "poweroff" ] && poweroff -f -d -n
[ "$1" = "halt" ] && halt -f -d -n [ "$ACTION" = "halt" ] && halt -f -d -n
[ "$1" = "kexec" ] && kexec -e [ "$ACTION" = "kexec" ] && kexec -e

warn "Shutdown called without an argument. Rebooting!"
reboot -f -d -n