diff --git a/packages/mediacenter/xbmc/init.d/61_xbmc b/packages/mediacenter/xbmc/init.d/61_xbmc index d63a879008..35eb2bee52 100755 --- a/packages/mediacenter/xbmc/init.d/61_xbmc +++ b/packages/mediacenter/xbmc/init.d/61_xbmc @@ -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