moin,
auch wenn einige jetzt rumgroehlen..Gibts schon , ueberfluessig..,
es kostet nix.
Das ist ein Script , was vom zb server die Anruferliste ausliest und sonstwo anzeigt.
Hier jetzt fuers VDR OSD.
Speziell laeuft hier eisfair mit capi2text und die Anrufe werden in anrufe.txt gespeichert. Ist aber leicht anzupassen, letztlich auch
egal was in/fuer ne Datei es ist.
Jedenfalls ist die Ausgabe so besser fuern VDR formatiert.
Bash
#!/bin/sh
#anrufer.sh /2007-09-14
#script to get calls from capi2text/eisfair and dispay them in a better order to stdout
# mountpoint of server , no need if you use ftp or wget or whatever
# !! isnt a good idea to store the file in a public folder like here
MOUNT="/media/server/public"
# server , if wget use something like http://_wherever_
SERVER="/media/server/public"
# callist on server
FILE="/anrufe.txt"
# where to store the file from server
TEMP1="/tmp/tmp_anrufe"
# finished output from awk
TEMP2="/tmp/caller.lst"
#how much lines you want to display (40 = last 20 phonecalls due the empty lines)
COUNTS=40
# cant get file from server e.g. mount error (samba only)
MESSAGE1="Transfer von Anruferliste fehlgeschlagen"
# error while copy the file from server
MESSAGE2="Kein Zugriff auf temporäre Anruferliste"
# error while finish file with awk
MESSAGE3="Anzeige fehlgeschlagen"
# ---- DO NOT EDIT ANYTHING , EXCEPT YOU DONT NEED/WANT TO MOUNT THE SERVER ----
# then place your ftp/wget command above and delete or comment the lines between #(START) and #(END)
# wget $SERVER$FILE -O "$TEMP1"
#(START)
mount $MOUNT
if [ -f "$SERVER$FILE" ]; then
cp -f "$SERVER$FILE" "$TEMP1"
umount $MOUNT
else
umount $MOUNT
echo "$MESSAGE1"
exit 1
fi
#(END)
if [ -f "$TEMP1" ]; then
awk -v FS="\t" '{ print $1 " " $2 " für " $4 " von [" $3 "]-" $5 "\n"; }' "$TEMP1" > "$TEMP2"
rm -f "$TEMP1"
else
echo "$MESSAGE2"
exit 1
fi
if [ -f "$TEMP2" ]; then
#how much lines to display (40 will get 20 calls due the emtpy line between caller see awk command)
tail -n $COUNTS "$TEMP2"
rm -f "$TEMP2"
else
echo "$MESSAGE3"
fi
Alles anzeigen