Oh xbmc why do you crash so much
#1
got fed up so I wrote this and put it on a cronjob

Checks if the web UI is up and kills if its not. In most XBMC freezes the web UI stops responding too, not all it seems but this is a start.

You have to have the web UI turned on for this to work


#!/bin/bash
XBMCuser=
XBMCpass=
XBMCport=
checkUI(){

# check if XBMC has crashed
echo "Checking XBMC"
RESULT=`wget --spider http://$XBMCuser:$[email protected]:$XBMCport 2>&1`
FLAG=0

for x in $RESULT; do
if [ "$x" = '200' ]; then
FLAG=1 # This means all good
fi
done
}

killandstart(){
#Kill XBMC if required and restart
killall -9 xbmc.bin
export DISPLAY=:0.0
xbmc &
}

checkUI

if [ $FLAG -eq 0 ]; then
echo "First check failed, trying again in 10 seconds"
sleep 10
checkUI
fi

if [ $FLAG -eq 0 ]; then
echo "XBMC is dead, restarting"
killandstart
else
echo "XBMC seems to be running just fine"
fi
Reply


Messages In This Thread
Oh xbmc why do you crash so much - by jamesdew - 2012-03-05, 02:26
Logout Mark Read Team Forum Stats Members Help
Oh xbmc why do you crash so much0