summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2015-10-11 11:26:48 +0200
committerMartin Väth <martin@mvath.de>2015-10-11 11:32:18 +0200
commit109d6b4f673a249aea4deeb0cdb5b54a21592410 (patch)
treeec3589a50dac5be54ef6248d1e0ff3a9fd3b41b4 /media-tv/sundtek-tv/files/mediaclient.video
downloadmv-109d6b4f673a249aea4deeb0cdb5b54a21592410.tar.gz
mv-109d6b4f673a249aea4deeb0cdb5b54a21592410.tar.bz2
mv-109d6b4f673a249aea4deeb0cdb5b54a21592410.zip
Clear history for egencache --repo=mv --update-changelogs
Diffstat (limited to 'media-tv/sundtek-tv/files/mediaclient.video')
-rw-r--r--media-tv/sundtek-tv/files/mediaclient.video31
1 files changed, 31 insertions, 0 deletions
diff --git a/media-tv/sundtek-tv/files/mediaclient.video b/media-tv/sundtek-tv/files/mediaclient.video
new file mode 100644
index 00000000..2382c21a
--- /dev/null
+++ b/media-tv/sundtek-tv/files/mediaclient.video
@@ -0,0 +1,31 @@
+#!/bin/sh
+Echo() {
+ printf '%s\n' "${*}"
+}
+Die() {
+ Echo "${0##*/}: ${*}" >&2
+ exit 1
+}
+EchoExec() {
+ Echo "# ${*}"
+ exec "${@}"
+ Die "failed to exec ${1}"
+}
+mediaclient=`PATH="${PATH}${PATH:+:}/bin:/opt/bin" command -v mediaclient` \
+ && [ -n "${mediaclient}" ] || Die 'cannot find mediaclient executable'
+case ${0} in
+*video*)
+ regexp='video[0-9]*'
+ text='video';;
+*radio)
+ regexp='radio[0-9]*'
+ text='radio';;
+*)
+ regexp='dvb\/adapter[0-9]*\/frontend[0-9]*'
+ text='adapter';;
+esac
+regexp='\/dev\/'${regexp}
+sedx='/'${regexp}'/{s/^.*\('${regexp}'\).*$/\1/p;q}'
+device=`"${mediaclient}" -e | sed -n -e "${sedx}"`
+[ -n "${device}" ] || Die "${mediaclient} -e returned no ${text} device"
+EchoExec "${mediaclient}" -d "${device}" "${@}"