2018-12-08 01:11:06 +05:30
|
|
|
#!/bin/sh
|
2017-05-31 23:45:32 +05:30
|
|
|
|
2017-07-12 01:11:29 +05:30
|
|
|
shutdown_arg=
|
|
|
|
while getopts :akrhPHfFnct: opt; do
|
2017-06-13 04:28:18 +05:30
|
|
|
case "$opt" in
|
2017-07-12 01:11:29 +05:30
|
|
|
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
|
2017-06-13 04:28:18 +05:30
|
|
|
exit 1
|
|
|
|
;;
|
2017-06-12 22:54:18 +05:30
|
|
|
esac
|
|
|
|
done
|
2017-06-13 04:28:18 +05:30
|
|
|
shift $((OPTIND-1))
|
2017-06-12 22:54:18 +05:30
|
|
|
|
2017-07-12 01:11:29 +05:30
|
|
|
if [ -z "${shutdown_arg}" ]; then
|
|
|
|
shutdown_arg=--single
|
2017-06-13 04:28:18 +05:30
|
|
|
fi
|
2017-06-12 22:54:18 +05:30
|
|
|
|
2017-07-12 01:11:29 +05:30
|
|
|
echo @SBINDIR@/openrc-shutdown ${shutdown_arg} "$@"
|
|
|
|
exec @SBINDIR@/openrc-shutdown ${shutdown_arg} "$@"
|