xbmc: rework shutdown and error handling

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-12-30 20:12:35 +01:00
parent bf06a26a69
commit 006a72d456

View File

@ -52,12 +52,25 @@ progress "starting XBMC"
DISPLAY=:0.0 xbmc $XBMC_ARGS > /dev/null 2>&1
RET=$?
echo "Exited with code $RET"
echo "Last XBMC Exitcode: $RET" >> /storage/.xbmc/last_exit.log
[ "$RET" == 0 ] && sync && poweroff
[ "$RET" == 64 ] && sync && poweroff
[ "$RET" == 66 ] && sync && reboot
case "$RET" in
0)
poweroff -f
;;
64)
poweroff -f
;;
66)
reboot
;;
255)
echo "Abnormal Exit. Exited with code $RET"
echo "is Xorg running? check /var/log/Xorg.log"
;;
*)
echo "Abnormal Exit. Exited with code $RET"
;;
esac
usleep 250000
done