mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 14:16:40 +00:00
xbmc & xbmc-pvr: redesign of poweroff and reboot. Change lock file location
This commit is contained in:
parent
33ef1232fb
commit
7e8f0340e3
@ -72,14 +72,15 @@ fi
|
|||||||
)&
|
)&
|
||||||
|
|
||||||
# prevent restrating XBMC at reboot or shutdown
|
# prevent restrating XBMC at reboot or shutdown
|
||||||
XBMC_LOCKED="/storage/xbmc_locked"
|
LOCKDIR="/var/lock/"
|
||||||
[ -f $XBMC_LOCKED ] && rm -f $XBMC_LOCKED &
|
LOCKFILE="xbmc.disabled"
|
||||||
|
[ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" &
|
||||||
|
|
||||||
# starting XBMC
|
# starting XBMC
|
||||||
usleep $XBMC_STARTDELAY
|
usleep $XBMC_STARTDELAY
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
while [ -f $XBMC_LOCKED ]; do
|
while [ -f "$LOCKDIR/$LOCKFILE" ]; do
|
||||||
usleep 250000
|
usleep 250000
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -89,19 +90,19 @@ fi
|
|||||||
case "$RET" in
|
case "$RET" in
|
||||||
0)
|
0)
|
||||||
if [ ! $(pidof console-kit-daemon) ]; then
|
if [ ! $(pidof console-kit-daemon) ]; then
|
||||||
touch $XBMC_LOCKED
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
poweroff -f
|
poweroff -f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
64)
|
64)
|
||||||
if [ ! $(pidof console-kit-daemon) ]; then
|
if [ ! $(pidof console-kit-daemon) ]; then
|
||||||
touch $XBMC_LOCKED
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
poweroff -f
|
poweroff -f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
66)
|
66)
|
||||||
if [ ! $(pidof console-kit-daemon) ]; then
|
if [ ! $(pidof console-kit-daemon) ]; then
|
||||||
touch $XBMC_LOCKED
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
0
packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit
Normal file → Executable file
0
packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit
Normal file → Executable file
@ -72,14 +72,15 @@ fi
|
|||||||
)&
|
)&
|
||||||
|
|
||||||
# prevent restrating XBMC at reboot or shutdown
|
# prevent restrating XBMC at reboot or shutdown
|
||||||
XBMC_LOCKED="/storage/xbmc_locked"
|
LOCKDIR="/var/lock/"
|
||||||
[ -f $XBMC_LOCKED ] && rm -f $XBMC_LOCKED &
|
LOCKFILE="xbmc.disabled"
|
||||||
|
[ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" &
|
||||||
|
|
||||||
# starting XBMC
|
# starting XBMC
|
||||||
usleep $XBMC_STARTDELAY
|
usleep $XBMC_STARTDELAY
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
while [ -f $XBMC_LOCKED ]; do
|
while [ -f "$LOCKDIR/$LOCKFILE" ]; do
|
||||||
usleep 250000
|
usleep 250000
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -89,19 +90,19 @@ fi
|
|||||||
case "$RET" in
|
case "$RET" in
|
||||||
0)
|
0)
|
||||||
if [ ! $(pidof console-kit-daemon) ]; then
|
if [ ! $(pidof console-kit-daemon) ]; then
|
||||||
touch $XBMC_LOCKED
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
poweroff -f
|
poweroff -f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
64)
|
64)
|
||||||
if [ ! $(pidof console-kit-daemon) ]; then
|
if [ ! $(pidof console-kit-daemon) ]; then
|
||||||
touch $XBMC_LOCKED
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
poweroff -f
|
poweroff -f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
66)
|
66)
|
||||||
if [ ! $(pidof console-kit-daemon) ]; then
|
if [ ! $(pidof console-kit-daemon) ]; then
|
||||||
touch $XBMC_LOCKED
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
0
packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit
Normal file → Executable file
0
packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit
Normal file → Executable file
@ -20,7 +20,8 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
XBMC_LOCKED="/storage/xbmc_locked"
|
LOCKDIR="/var/lock/"
|
||||||
touch $XBMC_LOCKED
|
LOCKFILE="xbmc.disabled"
|
||||||
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
wait_on_xbmc_exit
|
wait_on_xbmc_exit
|
||||||
reboot
|
reboot
|
||||||
|
@ -20,7 +20,8 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
XBMC_LOCKED="/storage/xbmc_locked"
|
LOCKDIR="/var/lock/"
|
||||||
touch $XBMC_LOCKED
|
LOCKFILE="xbmc.disabled"
|
||||||
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
wait_on_xbmc_exit
|
wait_on_xbmc_exit
|
||||||
poweroff
|
poweroff
|
||||||
|
Loading…
x
Reference in New Issue
Block a user