Cutinplace.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
(at != screen) |
|||
| Zeile 20: | Zeile 20: | ||
echo $"Cutinplace process already active" "(pid: $PID)" ... | echo $"Cutinplace process already active" "(pid: $PID)" ... | ||
else | 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\" & | |
| − | + | $SVDRPSENDCMD MESG \""$"Cutinplace process started"" (pid: \$!) ...\" ; \ | |
| − | + | echo \$! > \"$PIDFILE\" ; \ | |
| − | + | wait \$! ; \ | |
| − | + | rm -f \"$PIDFILE\" ; \ | |
| − | + | $SVDRPSENDCMD MESG \""$"Cutinplace process finished"" (pid: \$!) ...\" \ | |
| − | + | " | |
| + | fi | ||
fi | fi | ||
fi | fi | ||
Version vom 22. April 2006, 08:30 Uhr
Skript für cutinplace.
$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
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 [ -s "${PIDFILE:=$1/cip.pid}" ] ; then
read PID < "$PIDFILE"
echo $"Cutinplace process already active" "(pid: $PID)" ...
else
screen -dmS $$ sh -c \
" \
cutinplace \"$1\" &
$SVDRPSENDCMD MESG \""$"Cutinplace process started"" (pid: \$!) ...\" ; \
echo \$! > \"$PIDFILE\" ; \
wait \$! ; \
rm -f \"$PIDFILE\" ; \
$SVDRPSENDCMD MESG \""$"Cutinplace process finished"" (pid: \$!) ...\" \
"
fi
fi
fi