mirror of
https://github.com/outbackdingo/ports.git
synced 2026-03-19 20:13:26 +00:00
23 lines
307 B
Bash
Executable File
23 lines
307 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $(id -u) != 0 ]; then
|
|
echo $(basename $0): must be superuser.
|
|
exit 1
|
|
fi
|
|
|
|
prg=$(basename $0)
|
|
|
|
runit=/sbin/runit-init
|
|
|
|
case $prg in
|
|
poweroff|halt) action=0 ;;
|
|
reboot) action=6 ;;
|
|
*) exit 1 ;;
|
|
esac
|
|
|
|
if [ $action = 6 ]; then
|
|
touch /run/runit.reboot
|
|
fi
|
|
|
|
$runit $action
|