aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-12 20:15:58 +0000
committerRoy Marples <roy@marples.name>2008-02-12 20:15:58 +0000
commit096ac08fe356169f82c43fbf1d02aae4c8e2a360 (patch)
treebd0c04debc201cc51c420a75a4cd41927eac6abf
parent567f8e33f2f7d951237996b6b2dd60189515754d (diff)
Some BSD's init don't send an action to rc.shutdown, so assume shutdown
-rw-r--r--etc.BSD/rc.shutdown.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/etc.BSD/rc.shutdown.in b/etc.BSD/rc.shutdown.in
index b531f308..48abe703 100644
--- a/etc.BSD/rc.shutdown.in
+++ b/etc.BSD/rc.shutdown.in
@@ -13,12 +13,14 @@ export LD_LIBRARY_PATH="/lib${LD_LIBRARY_PATH:+:}${LDLIBRARY_PATH}"
# This gives us a nice colour boot :)
[ -z "$TERM" -o "$TERM" = "dumb" ] && export TERM="@TERM@"
+action=${1:-shutdown}
+
# BSD's init works somewhat differently to sysvinit.
# This block should 'translate' from the way init calls it to the way it would
# be called by sysvinit on linux.
-case "$1" in
+case "${action}" in
reboot) export RUNLEVEL=6;;
- shutdown) export RUNLEVEL=0;;
single) export RUNLEVEL=S;;
+ *) export RUNLEVEL=0;;
esac
-exec /sbin/rc "$1"
+exec /sbin/rc "${action}"