mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
busybox: add initial support for shutdown scripts
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
@@ -46,6 +46,8 @@
|
||||
progress "Starting Init Scripts"
|
||||
RET=0
|
||||
|
||||
RUNLEVEL="boot"
|
||||
|
||||
for script in `ls -1 /etc/init.d/*`; do
|
||||
if grep -q -e "^# runlevels:.*$MODE" $script; then
|
||||
. $script
|
||||
@@ -53,3 +55,15 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user