2008-12-06, 02:47
I'd like to make a script I could run (as a cron job maybe) that auto-restarts XBMC if it dies (since unfortunately that seems to happen with my system). I'm thinking it could be something like this:
However, when I tested this via SSH it (of course) changed the display commands to my shell, so the mouse & keyboard stopped working on the TV (even though display did go correctly to the TV). Any ideas how to improve this? Or even do it correctly? Or what the correct crontab run line would look like?
Code:
#!/bin/sh
if [ $(pidof xbmc.bin) ];
then
echo "" #do nothing
else
echo "XMBC Stopped, Re-starting"
export set DISPLAY=:0
/usr/bin/xbmc
fi
echo $PID