Skip to content

Commit

Permalink
scripts: fix halt, poweroff and reboot wrappers
Browse files Browse the repository at this point in the history
These are designed to emulate the sysvinit equivalents, so pass "now" as
the time argument if no arguments are given.

This fixes #268.
  • Loading branch information
udeved authored and williamh committed Dec 27, 2018
1 parent 3e00fbc commit a15b532
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion scripts/halt.in
Expand Up @@ -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}"
7 changes: 6 additions & 1 deletion scripts/poweroff.in
Expand Up @@ -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}"
7 changes: 6 additions & 1 deletion scripts/reboot.in
Expand Up @@ -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}"

0 comments on commit a15b532

Please sign in to comment.