Savvy.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Zeile 1: Zeile 1:
<pre>#!/bin/sh
+
<pre>
 +
#!/bin/sh
 
#
 
#
 
# sample script for savvy
 
# sample script for savvy
Zeile 54: Zeile 55:
 
sleep 1s && testproc savvy && {
 
sleep 1s && testproc savvy && {
 
     msg "MESG: savvy startet..."
 
     msg "MESG: savvy startet..."
}</pre>
+
}
 +
</pre>
 +
 
 +
[[Kategorie:Scripts]]

Version vom 20. November 2004, 19:45 Uhr

#!/bin/sh
#
# sample script for savvy
#
# need: mplayer, savvy, lame, wget, at, normalize (optional)

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$SOURCEDIR/savvy

SAVVYOPT="-nn"

msg() {
    echo -e "-----------\n${@}\n-----------"
}

testproc() {
    test "$(ps axc|awk "{if (\$5==\"$1\") print \$1}")"
}

for i in lame wget at savvy mplayer ; do
    which "${i}" >/dev/null 2>&1 || {
	msg "ERROR: ${i} not found..."
	exit 1
    }
done

testproc savvy && {
    msg "MESG: savvy is always running..."
    exit 1
}

ping -c 2 www.viva.de >/dev/null 2>&1 || {
    msg "ERROR: check your www connection..."
    exit 1
}

cd $SOURCEDIR/savvy

rm -f *.html

wget -c http://www.vivaplus.tv/gettheclip.html || {
    msg "ERROR: check your www connection..."
    exit 1
}

test ! -e gettheclip.html && {
    msg "ERROR: gettheclip.html not exist, check the www connection..."
    exit 1
}

at now <<EOM
./savvy ${SAVVYOPT} ${1}/
EOM

sleep 1s && testproc savvy && {
    msg "MESG: savvy startet..."
}