Noad.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
K (Zuordnung)
Zeile 1: Zeile 1:
 +
Script von [[noad]].
 +
 +
{{Box Datei | $PATH/noad.sh |
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
Zeile 9: Zeile 12:
 
# folgende zeilen in die reccmds.conf eintragen:
 
# folgende zeilen in die reccmds.conf eintragen:
 
#
 
#
# Run noad                        : /usr/local/bin/noad.sh -start
+
# Run noad                        : /path_to_this_script/noad.sh -start
# Run noad, all recordings (batch) : /usr/local/bin/noad.sh -batch
+
# Run noad, all recordings (batch) : /path_to_this_scrip/noad.sh -batch
# View Cut list                    : /usr/local/bin/noad.sh -view
+
# View Cut list                    : /path_to_this_scrip/noad.sh -view
# In prozess                      : /usr/local/bin/noad.sh -count
+
# In prozess                      : /path_to_this_scrip/noad.sh -count
# Stop noad (killpid)              : /usr/local/bin/noad.sh -killpid
+
# Stop noad (killpid)              : /path_to_this_scrip/noad.sh -killpid
# Stop noad (killall)?            : /usr/local/bin/noad.sh -killall
+
# Stop noad (killall)?            : /path_to_this_scrip/noad.sh -killall
# Remove marks                    : /usr/local/bin/noad.sh -marks
+
# Remove marks                    : /path_to_this_scrip/noad.sh -marks
# Remove pid                      : /usr/local/bin/noad.sh -pid
+
# Remove pid                      : /path_to_this_scrip/noad.sh -pid
# Remove all marks                : /usr/local/bin/noad.sh -marks.vdr
+
# Remove all marks                : /path_to_this_scrip/noad.sh -marks.vdr
# Remove all pids                  : /usr/local/bin/noad.sh -noad.pid
+
# Remove all pids                  : /path_to_this_scrip/noad.sh -noad.pid
  
 
# CONFIG START
 
# CONFIG START
Zeile 98: Zeile 101:
 
esac
 
esac
 
</pre>
 
</pre>
 +
}}
  
 
[[Kategorie:Scripts]]
 
[[Kategorie:Scripts]]

Version vom 20. Juli 2005, 14:28 Uhr

Script von noad.

Datei
$PATH/noad.sh
#!/bin/bash
#
# noad.sh
#
# Required: noad, at
#
# add this lines to your reccmds.conf:
# folgende zeilen in die reccmds.conf eintragen:
#
# Run noad                         : /path_to_this_script/noad.sh -start
# Run noad, all recordings (batch) : /path_to_this_scrip/noad.sh -batch
# View Cut list                    : /path_to_this_scrip/noad.sh -view
# In prozess                       : /path_to_this_scrip/noad.sh -count
# Stop noad (killpid)              : /path_to_this_scrip/noad.sh -killpid
# Stop noad (killall)?             : /path_to_this_scrip/noad.sh -killall
# Remove marks                     : /path_to_this_scrip/noad.sh -marks
# Remove pid                       : /path_to_this_scrip/noad.sh -pid
# Remove all marks                 : /path_to_this_scrip/noad.sh -marks.vdr
# Remove all pids                  : /path_to_this_scrip/noad.sh -noad.pid

# CONFIG START
  NOADOPTS="nice --background --ac3 --asd --overlap --jumplogo --comments --OSD --statisticfile=/var/log/vdr/noadstat"
  VDR_VIDEO="/video"
# CONFIG END

PATH=/usr/local/bin:$PATH

case "$1" in
    -start)
	echo "recording: "
	echo
	echo "$2"
	echo
	if [ -e "$2/noad.pid" ] ; then
	    echo "noad is already active..."
	else
	    echo "noad $NOADOPTS \"$2\" >/dev/null 2>&1" | at now
	    echo "noad startet..."
	fi
	;;
    -batch)
	while read i ; do
	    if [ ! -e "$i/marks.vdr" -a ! -e "$i/noad.pid" ] ; then
		echo "noad $NOADOPTS \"$i\" >/dev/null 2>&1" | batch
	    fi
	done < <(find "$VDR_VIDEO" -follow -name "*.rec")
	;;
    -view)
	echo "recording: "
	echo
	echo "$2"
	echo
	if [ -e "$2/noad.pid" ] ; then
	    echo "noad is still active..."
	    echo
	fi
	if [ -e "$2/marks.vdr" ] ; then
	    cat "$2/marks.vdr"
	else
	    echo "cut list not found..."
	fi
	;;
    -count)
	echo "all noad processes:"
	echo
	pidof noad | wc -w | tr -d ' '
	;;
    -killpid)
	echo "recording: "
	echo
	echo "$2"
	echo
	if [ -e "$2/noad.pid" ] ; then
	    kill `cat "$2/noad.pid"`
	    echo "noad stopped..."
	else
	    echo "noad is not active..."
	fi
	;;
    -killall)
	PID=`pidof noad`
	eval ${PID:+kill $PID}
	;;
    -marks)
	rm -f "$2/marks.vdr"
	;;
    -pid)
	rm -f "$2/noad.pid"
	;;
    -marks.vdr|-noad.pid)
	find "$VDR_VIDEO" -follow -type f -name "${1/-}" -exec  rm -f '{}' ';' &
	;;
    *)
	echo "unrecognized option: $1"
	exit 1
	;;
esac