fs

morpheus filesystem files
git clone git://git.2f30.org/fs
Log | Files | Refs

commit e83966a851af4b6db23c2e477bf2ab398997ae3a
parent d8d9cda79187a7f933ec656d20426c932285ad67
Author: sin <sin@2f30.org>
Date:   Fri,  7 Feb 2014 11:46:49 +0000

Use a case statement and check against invalid actions

Diffstat:
Mbin/rc.shutdown | 18+++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/bin/rc.shutdown b/bin/rc.shutdown @@ -4,6 +4,15 @@ PATH=/bin . /etc/rc.conf +case "$1" in +reboot|poweroff) + ;; +*) + echo "Invalid action '$1' for rc.shutdown" 1>&2 + exit 1 + ;; +esac + echo Shutting down hwclock -u -w @@ -29,8 +38,11 @@ wait echo bye -if test "$1" = "reboot"; then +case "$1" in +reboot) halt -r -else + ;; +poweroff) halt -p -fi + ;; +esac