Clipinc.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
(M) |
(M) |
||
| Zeile 6: | Zeile 6: | ||
# | # | ||
# clipinc.sh | # clipinc.sh | ||
| − | |||
| − | |||
# | # | ||
# add this lines to your reccmds.conf: | # add this lines to your reccmds.conf: | ||
# folgende zeilen in die reccmds.conf eintragen: | # folgende zeilen in die reccmds.conf eintragen: | ||
# | # | ||
| − | # Run clipinc | + | # Run clipinc : /path_to_this_script/clipinc.sh -start |
| − | + | # Stop clipinc? : /path_to_this_script/clipinc.sh -kill | |
| − | # Stop clipinc? | + | |
# CONFIG START | # CONFIG START | ||
| − | |||
| − | |||
| − | |||
CLIPINC_LOGFILE="/var/log/vdr/clipinc.log" | CLIPINC_LOGFILE="/var/log/vdr/clipinc.log" | ||
# CONFIG END | # CONFIG END | ||
| − | |||
| − | |||
case "$1" in | case "$1" in | ||
-start) | -start) | ||
| − | |||
PID=`pidof -x clipinc.pl` | PID=`pidof -x clipinc.pl` | ||
| − | if [ -n " | + | if [ -n "$PID" ] ; then |
| − | + | echo $"Clipinc process already active (pid: $PID)" ... | |
else | else | ||
| − | if | + | if pidof atd >/dev/null ; then |
| − | + | if [ -e "$2/recinfo.conf" ] ; then | |
| − | + | ( | |
| − | + | echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$"Clipinc process started"" ... >/dev/null" | |
| − | + | echo "clipinc.pl \"$2\" > $CLIPINC_LOGFILE 2>&1" | |
| − | + | echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$"Clipinc process finished"" ... >/dev/null" | |
| − | - | + | ) | at now |
| − | + | else | |
| − | + | echo $"recinfo.conf not found" ... | |
| − | + | fi | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
else | else | ||
| − | + | echo $"Jobmanager (atd) is not running" ... | |
fi | fi | ||
| − | fi | + | fi |
| − | + | ||
| − | + | ||
;; | ;; | ||
-kill) | -kill) | ||
| − | pidof -x clipinc.pl | xargs -r kill -9 | + | pidof vdrcut -x clipinc.pl | xargs -r kill -9 |
;; | ;; | ||
esac | esac | ||
Version vom 7. Januar 2006, 13:27 Uhr
Script für clipinc
#!/bin/sh
#
# clipinc.sh
#
# add this lines to your reccmds.conf:
# folgende zeilen in die reccmds.conf eintragen:
#
# Run clipinc : /path_to_this_script/clipinc.sh -start
# Stop clipinc? : /path_to_this_script/clipinc.sh -kill
# CONFIG START
CLIPINC_LOGFILE="/var/log/vdr/clipinc.log"
# CONFIG END
case "$1" in
-start)
PID=`pidof -x clipinc.pl`
if [ -n "$PID" ] ; then
echo $"Clipinc process already active (pid: $PID)" ...
else
if pidof atd >/dev/null ; then
if [ -e "$2/recinfo.conf" ] ; then
(
echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$"Clipinc process started"" ... >/dev/null"
echo "clipinc.pl \"$2\" > $CLIPINC_LOGFILE 2>&1"
echo "svdrpsend.pl -p ${VDR_PORT:-2001} MESG "$"Clipinc process finished"" ... >/dev/null"
) | at now
else
echo $"recinfo.conf not found" ...
fi
else
echo $"Jobmanager (atd) is not running" ...
fi
fi
;;
-kill)
pidof vdrcut -x clipinc.pl | xargs -r kill -9
;;
esac