aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-07-11 14:41:29 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-07-11 14:41:29 -0500
commite7807b3136d8993805082320784460f5059e6275 (patch)
tree82ae060795a746c62d2e95cdff7e52b38567fcec
parent03a461ac0ee34b7900868cdea624c6fd868b1656 (diff)
fix sysvinit compatibility for shutdown wrapper
-rw-r--r--scripts/shutdown.in28
1 files changed, 18 insertions, 10 deletions
diff --git a/scripts/shutdown.in b/scripts/shutdown.in
index 69a4a12a..7d68bf09 100644
--- a/scripts/shutdown.in
+++ b/scripts/shutdown.in
@@ -1,21 +1,29 @@
#!@SHELL@
-poweroff_arg=
-while getopts :HhPr opt; do
+shutdown_arg=
+while getopts :akrhPHfFnct: opt; do
case "$opt" in
- h|P) poweroff_arg=--poweroff ;;
- H) poweroff_arg=--halt ;;
- r) poweroff_arg=--reboot ;;
- \?) printf "${0##*/}: invalid option ${optarg}\n" >&2
+ a) ;;
+ k) ;;
+ r) shutdown_arg=--reboot ;;
+ h) shutdown_arg=--halt ;;
+ P) shutdown_arg=--poweroff ;;
+ H) shutdown_arg=--halt ;;
+ f) ;;
+ F) ;;
+ n) ;;
+ c) ;;
+ t) ;;
+ [?]) printf "%s\n" "${0##*/}: invalid command line option" >&2
exit 1
;;
esac
done
shift $((OPTIND-1))
-if [ -z "${poweroff_arg}" ]; then
- poweroff_arg=--single
+if [ -z "${shutdown_arg}" ]; then
+ shutdown_arg=--single
fi
-echo @SBINDIR@/openrc-shutdown ${poweroff_arg} ${@}
-exec @SBINDIR@/openrc-shutdown ${poweroff_arg} ${@}
+echo @SBINDIR@/openrc-shutdown ${shutdown_arg} "$@"
+exec @SBINDIR@/openrc-shutdown ${shutdown_arg} "$@"