Cutinplace.sh
Aus VDR Wiki
Version vom 4. Juni 2006, 08:40 Uhr von 84.186.33.19 (Diskussion)
Vorschlag für ein einfaches Skript um cutinplace zu starten, welches über die reccmds.conf ausgeführt werden kann.
$PATH/cutinplace.sh
#!/bin/sh
#
# cutinplace.sh
#
# add this line to your reccmds.conf:
# folgende zeile in die reccmds.conf eintragen:
#
# cutinplace : /path_to_this_script/cutinplace.sh
which cutinplace >/dev/null 2>&1 || { echo cutinplace $"not found" ... ; exit 1 ; }
MARKS=$(wc -l < "$1/marks.vdr" 2>/dev/null)
if [ ${MARKS:-0} -lt 2 ] ; then
echo $"No editing marks defined" ...
else
if [ -s "${PIDFILE:=$1/cip.pid}" ] ; then
read PID < "$PIDFILE"
echo $"Cutinplace process already active" "(pid: $PID)" ...
else
screen -dmS $$ sh -c \
" \
cutinplace \"$1\" &
svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process started"" (pid: \$!) ...\" ; \
echo \$! > \"$PIDFILE\" ; \
wait \$! ; \
rm -f \"$PIDFILE\" ; \
svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process finished"" (pid: \$!) ...\" \
"
fi
fi