summaryrefslogtreecommitdiff
path: root/package/xbmc/files/xbmc.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/xbmc/files/xbmc.init')
-rw-r--r--package/xbmc/files/xbmc.init29
1 files changed, 29 insertions, 0 deletions
diff --git a/package/xbmc/files/xbmc.init b/package/xbmc/files/xbmc.init
new file mode 100644
index 000000000..ed8a49bd6
--- /dev/null
+++ b/package/xbmc/files/xbmc.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#PKG xbmc
+#INIT 95
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${xbmc:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ export LD_LIBRARY_PATH=/opt/vc/lib
+ xbmc &
+ ;;
+stop)
+ kill $(pgrep -f /usr/bin/xbmc)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?