aboutsummaryrefslogtreecommitdiff
path: root/tools/XBMCLive/runXBMC
diff options
context:
space:
mode:
authorAlTheKiller <AlTheKiller@svn>2009-09-23 01:49:50 +0000
committerAlTheKiller <AlTheKiller@svn>2009-09-23 01:49:50 +0000
commit45285e8a9300cd754a760560640b75b09f98035e (patch)
treead9f093885ad5c98e9dd4156674e7691c22ed0a2 /tools/XBMCLive/runXBMC
step 3/4: Move linuxport to trunk. How'd I get roped into this?
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23097 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools/XBMCLive/runXBMC')
-rwxr-xr-xtools/XBMCLive/runXBMC41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/XBMCLive/runXBMC b/tools/XBMCLive/runXBMC
new file mode 100755
index 0000000000..a6d3125b0f
--- /dev/null
+++ b/tools/XBMCLive/runXBMC
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+if [ "$(pidof X)" ] ; then
+ /usr/share/xbmc/xbmc.bin --standalone
+ exit
+fi
+
+while true
+do
+ echo "#!/bin/bash" > /home/xbmc/.xsession
+ echo "/usr/share/xbmc/xbmc.bin --standalone" >> /home/xbmc/.xsession
+
+ echo "case \"\$?\" in" >> /home/xbmc/.xsession
+ echo " 0 ) # Quit" >> /home/xbmc/.xsession
+ echo " touch /tmp/noRestartXBMC" >> /home/xbmc/.xsession
+ echo " break ;;" >> /home/xbmc/.xsession
+ echo " 64 ) # Shutdown System" >> /home/xbmc/.xsession
+ echo " sleep 10 ;;" >> /home/xbmc/.xsession
+ echo " 65 ) # Warm Reboot" >> /home/xbmc/.xsession
+ echo " echo "Restarting XBMC ..." ;;" >> /home/xbmc/.xsession
+ echo " 66 ) # Reboot System" >> /home/xbmc/.xsession
+ echo " sleep 10 ;;" >> /home/xbmc/.xsession
+ echo " * ) ;;" >> /home/xbmc/.xsession
+ echo "esac" >> /home/xbmc/.xsession
+
+ chown xbmc:xbmc /home/xbmc/.xsession
+
+ if [ "$(whoami)" == "root" ] ; then
+ su xbmc -c "startx -- -br > /dev/null 2>&1" -l
+ else
+ startx -- -br > /dev/null 2>&1
+ fi
+
+ if [ -e /tmp/noRestartXBMC ] ; then
+ rm /tmp/noRestartXBMC
+ rm /home/xbmc/.xsession
+ break
+ fi
+
+# sleep 2
+done