xbmc & xbmc-pvr: redesign of poweroff and reboot. Change lock file location

This commit is contained in:
Gregor Fuis 2012-02-27 21:32:59 +01:00
parent 33ef1232fb
commit 7e8f0340e3
6 changed files with 20 additions and 16 deletions

View File

@ -72,14 +72,15 @@ fi
)&
# prevent restrating XBMC at reboot or shutdown
XBMC_LOCKED="/storage/xbmc_locked"
[ -f $XBMC_LOCKED ] && rm -f $XBMC_LOCKED &
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
[ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" &
# starting XBMC
usleep $XBMC_STARTDELAY
while true; do
while [ -f $XBMC_LOCKED ]; do
while [ -f "$LOCKDIR/$LOCKFILE" ]; do
usleep 250000
done
@ -89,19 +90,19 @@ fi
case "$RET" in
0)
if [ ! $(pidof console-kit-daemon) ]; then
touch $XBMC_LOCKED
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
64)
if [ ! $(pidof console-kit-daemon) ]; then
touch $XBMC_LOCKED
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
66)
if [ ! $(pidof console-kit-daemon) ]; then
touch $XBMC_LOCKED
touch "$LOCKDIR/$LOCKFILE"
reboot
fi
;;

View File

View File

@ -72,14 +72,15 @@ fi
)&
# prevent restrating XBMC at reboot or shutdown
XBMC_LOCKED="/storage/xbmc_locked"
[ -f $XBMC_LOCKED ] && rm -f $XBMC_LOCKED &
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
[ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" &
# starting XBMC
usleep $XBMC_STARTDELAY
while true; do
while [ -f $XBMC_LOCKED ]; do
while [ -f "$LOCKDIR/$LOCKFILE" ]; do
usleep 250000
done
@ -89,19 +90,19 @@ fi
case "$RET" in
0)
if [ ! $(pidof console-kit-daemon) ]; then
touch $XBMC_LOCKED
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
64)
if [ ! $(pidof console-kit-daemon) ]; then
touch $XBMC_LOCKED
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
66)
if [ ! $(pidof console-kit-daemon) ]; then
touch $XBMC_LOCKED
touch "$LOCKDIR/$LOCKFILE"
reboot
fi
;;

0
packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit Normal file → Executable file
View File

View File

@ -20,7 +20,8 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
XBMC_LOCKED="/storage/xbmc_locked"
touch $XBMC_LOCKED
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
touch "$LOCKDIR/$LOCKFILE"
wait_on_xbmc_exit
reboot

View File

@ -20,7 +20,8 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
XBMC_LOCKED="/storage/xbmc_locked"
touch $XBMC_LOCKED
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
touch "$LOCKDIR/$LOCKFILE"
wait_on_xbmc_exit
poweroff