Cutinplace.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(M)
(M)
 
(7 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
Script für [[cutinplace]].
+
Vorschlag für ein einfaches Skript um [[cutinplace]] zu ''starten'', welches über die [[reccmds.conf]] ausgeführt werden kann.
  
{{Box Datei | $PATH/cutinplace.sh |
+
{{Box Datei | [[Struktur|$PATH]]/cutinplace.sh |
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
Zeile 11: Zeile 11:
 
#
 
#
 
# cutinplace : /path_to_this_script/cutinplace.sh
 
# 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)
 
MARKS=$(wc -l < "$1/marks.vdr" 2>/dev/null)
Zeile 20: Zeile 22:
 
echo $"Cutinplace process already active" "(pid: $PID)" ...
 
echo $"Cutinplace process already active" "(pid: $PID)" ...
 
     else
 
     else
if pidof atd >/dev/null ; then
+
screen -dm sh -c \
    (
+
" \
echo "cutinplace \"$1\" >/dev/null &"
+
    cutinplace \"$1\" &
echo "PID=\$!"
+
    svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process started"" (pid: \$!) ...\" ; \
echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process started"" (pid: \$PID) ...\" >/dev/null"
+
    echo \$! > \"$PIDFILE\" ; \
echo "echo \$PID > \"$PIDFILE\""
+
    wait \$! ; \
echo "wait \$PID"
+
    rm -f \"$PIDFILE\" ; \
echo "rm -f \"$PIDFILE\""
+
    svdrpsend.pl -p ${VDR_PORT:-2001} MESG \""$"Cutinplace process finished"" (pid: \$!) ...\" \
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
 
fi
 
fi
Zeile 38: Zeile 36:
 
}}
 
}}
  
[[Kategorie:Scripts]]
+
==Quellen==
 +
* [[cutinplace]]
 +
 
 +
[[Kategorie:Skripte]]

Aktuelle Version vom 12. Juni 2006, 10:03 Uhr

Vorschlag für ein einfaches Skript um cutinplace zu starten, welches über die reccmds.conf ausgeführt werden kann.

Datei
$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 -dm 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


[Bearbeiten] Quellen