2017-05-31 23:45:32 +05:30
|
|
|
#!@SHELL@
|
|
|
|
|
2017-06-13 04:28:18 +05:30
|
|
|
poweroff_arg=
|
|
|
|
while getopts :HhPr 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
|
|
|
|
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-06-13 04:28:18 +05:30
|
|
|
if [ -z "${poweroff_arg}" ]; then
|
|
|
|
poweroff_arg=--single
|
|
|
|
fi
|
2017-06-12 22:54:18 +05:30
|
|
|
|
2017-06-13 04:28:18 +05:30
|
|
|
echo @SBINDIR@/openrc-shutdown ${poweroff_arg} ${@}
|
|
|
|
exec @SBINDIR@/openrc-shutdown ${poweroff_arg} ${@}
|