mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 14:16:40 +00:00
ConsoleKit: add proper shutdown support via init scripts
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
a839b0b65a
commit
626b77cf83
@ -68,13 +68,13 @@ case $RUNLEVEL in
|
||||
|
||||
case "$RET" in
|
||||
0)
|
||||
poweroff -f
|
||||
RUNLEVEL="poweroff"
|
||||
;;
|
||||
64)
|
||||
poweroff -f
|
||||
RUNLEVEL="poweroff"
|
||||
;;
|
||||
66)
|
||||
reboot
|
||||
RUNLEVEL="reboot"
|
||||
;;
|
||||
255)
|
||||
echo "Abnormal Exit. Exited with code $RET"
|
||||
|
@ -20,4 +20,20 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
reboot
|
||||
. /etc/profile
|
||||
|
||||
progress "Reboot the syste"
|
||||
RET=0
|
||||
|
||||
RUNLEVEL="reboot"
|
||||
|
||||
for script in `ls -r1 /etc/init.d/*`; do
|
||||
if grep -q -e "^# runlevels:.*$MODE" $script; then
|
||||
. $script
|
||||
S_RET=$?
|
||||
test $S_RET -ge $RET && RET=$S_RET
|
||||
fi
|
||||
done
|
||||
|
||||
sync
|
||||
reboot
|
||||
|
@ -20,4 +20,20 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
poweroff
|
||||
. /etc/profile
|
||||
|
||||
progress "Poweroff the system"
|
||||
RET=0
|
||||
|
||||
RUNLEVEL="poweroff"
|
||||
|
||||
for script in `ls -r1 /etc/init.d/*`; do
|
||||
if grep -q -e "^# runlevels:.*$MODE" $script; then
|
||||
. $script
|
||||
S_RET=$?
|
||||
test $S_RET -ge $RET && RET=$S_RET
|
||||
fi
|
||||
done
|
||||
|
||||
sync
|
||||
poweroff -f
|
||||
|
@ -55,15 +55,3 @@
|
||||
test $S_RET -ge $RET && RET=$S_RET
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$RUNLEVEL" -o $RUNLEVEL="boot" ]; then
|
||||
RUNLEVEL="poweroff"
|
||||
fi
|
||||
|
||||
for script in `ls -r1 /etc/init.d/*`; do
|
||||
if grep -q -e "^# runlevels:.*$MODE" $script; then
|
||||
. $script
|
||||
S_RET=$?
|
||||
test $S_RET -ge $RET && RET=$S_RET
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user