Cutinplace.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
(M) |
(M) |
||
| Zeile 17: | Zeile 17: | ||
else | else | ||
if [ -s "${PIDFILE:=$1/cip.pid}" ] ; then | if [ -s "${PIDFILE:=$1/cip.pid}" ] ; then | ||
| − | read | + | read PID < "$PIDFILE" |
| − | echo $" | + | echo $"Cutinplace process already active" "(pid: $PID)" ... |
else | else | ||
if pidof atd >/dev/null ; then | if pidof atd >/dev/null ; then | ||
( | ( | ||
| − | |||
echo "cutinplace \"$1\" >/dev/null &" | echo "cutinplace \"$1\" >/dev/null &" | ||
echo "PID=\$!" | echo "PID=\$!" | ||
| + | echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process started"" (pid: \$PID) ...\" >/dev/null" | ||
echo "echo \$PID > \"$PIDFILE\"" | echo "echo \$PID > \"$PIDFILE\"" | ||
echo "wait \$PID" | echo "wait \$PID" | ||
echo "rm -f \"$PIDFILE\"" | echo "rm -f \"$PIDFILE\"" | ||
| − | echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$" | + | echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process finished"" (pid: \$PID) ...\" >/dev/null" |
) | at now | ) | at now | ||
else | else | ||
Version vom 7. Januar 2006, 14:18 Uhr
Script für cutinplace.
#!/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
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
if pidof atd >/dev/null ; then
(
echo "cutinplace \"$1\" >/dev/null &"
echo "PID=\$!"
echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process started"" (pid: \$PID) ...\" >/dev/null"
echo "echo \$PID > \"$PIDFILE\""
echo "wait \$PID"
echo "rm -f \"$PIDFILE\""
echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process finished"" (pid: \$PID) ...\" >/dev/null"
) | at now
else
echo $"Jobmanager (atd) is not running" ...
fi
fi
fi