Savvy.sh

Aus VDR Wiki
Version vom 21. August 2004, 00:55 Uhr von 213.6.81.82 (Diskussion)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche
#!/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() {
    ps -eo%c|grep -q ^${@}$
}

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 >/dev/null && {
    msg "MESG: savvy is allways 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 >/dev/null && {
    msg "MESG: savvy startet..."
}