aboutsummaryrefslogtreecommitdiffstats
path: root/main/omxplayer/omxplayer.initd
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-11-28 11:57:14 +0200
committerTimo Teräs <timo.teras@iki.fi>2014-11-28 11:58:32 +0200
commitf326e24997c33cf9a96eeebda6da6dcdadc23b20 (patch)
tree3c5dec24a79f6092d82d65f981229907e3eedab9 /main/omxplayer/omxplayer.initd
parent67fced8217a429f0a57cd3fc23a3a690cdcd3297 (diff)
downloadaports-f326e24997c33cf9a96eeebda6da6dcdadc23b20.tar.bz2
aports-f326e24997c33cf9a96eeebda6da6dcdadc23b20.tar.xz
main/omxplayer: upgrade to 2014-11-27, add init.d script
Diffstat (limited to 'main/omxplayer/omxplayer.initd')
-rw-r--r--main/omxplayer/omxplayer.initd34
1 files changed, 34 insertions, 0 deletions
diff --git a/main/omxplayer/omxplayer.initd b/main/omxplayer/omxplayer.initd
new file mode 100644
index 0000000000..72c632d4ff
--- /dev/null
+++ b/main/omxplayer/omxplayer.initd
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+
+depend() {
+ after net firewall chrony
+}
+
+omxplayer_run_loop() {
+ while true; do
+ /usr/bin/omxplayer "$@"
+ status=$?
+ echo "exited: $status"
+ [ "$status" -eq 129 ] && exit 0
+ sleep 0.2
+ done
+}
+
+checkconfig() {
+ [ -z "$OMXPLAYER_URL" ] && eerror "omxplayer URL not set"
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting omxplayer"
+ omxplayer_run_loop ${OMXPLAYER_OPTS} ${OMXPLAYER_URL} 2>&1 | logger -t omxplayer &
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping omxplayer"
+ killall -HUP omxplayer
+ eend $?
+}
+