aboutsummaryrefslogtreecommitdiff
blob: cea3465d8937fe64a80f2be54e88787098c8cf3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# $Id$
# Author:
#   Matthias Schwarzott <zzam@gmx.de>
#
# This is a multiplexer for all things vdr can call with vdr -r script (e.g. noad ...)
# It calls all shell-scripts located in /usr/share/vdr/record in alphabetical order

include svdrpcmd
svdrp_command

#fork to background
if [ -z "${EXECUTED_BY_VDR_BG}" ]; then
	exec /usr/share/vdr/bin/vdr-bg.sh "${0}" "${@}"
	exit
fi

HOOKDIR=/usr/share/vdr/record
OLD_HOOKDIR=/usr/lib/vdr/record

. /usr/share/vdr/inc/functions.sh

mesg() {
	"${SVDRPCMD}" MESG "\"$@\""
}

VDR_RECORD_STATE="$1"
VDR_RECORD_NAME="$2"
VDR_RECORD_NEW_NAME="$3"

for HOOK in ${HOOKDIR}/record-*.sh ${OLD_HOOKDIR}/record-*.sh; do
	[ -f "${HOOK}" ] && . "${HOOK}" "$@"
done