scripts: fix halt, poweroff and reboot wrappers

These are designed to emulate the sysvinit equivalents, so pass "now" as
the time argument if no arguments are given.

This fixes #268.
This commit is contained in:
artoo 2018-12-13 11:55:25 +01:00 committed by William Hubbs
parent 3e00fbc9b0
commit a15b532a02
3 changed files with 18 additions and 3 deletions

View File

@ -21,4 +21,9 @@ if [ -z "${poweroff_arg}" ]; then
poweroff_arg=--poweroff
fi
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"
script_args="$@"
if [ -z "${script_args}" ]; then
script_args=now
fi
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"

View File

@ -20,4 +20,9 @@ if [ -z "${poweroff_arg}" ]; then
poweroff_arg=--poweroff
fi
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"
script_args="$@"
if [ -z "${script_args}" ]; then
script_args=now
fi
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"

View File

@ -22,4 +22,9 @@ if [ -z "${poweroff_arg}" ]; then
poweroff_arg=--reboot
fi
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"
script_args="$@"
if [ -z "${script_args}" ]; then
script_args=now
fi
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"