#!/bin/sh
# von Alex zur Aufnahmekontrolle auf das LCD geschrieben..../10/2005
# Das Script mit den Rechten 755 nach /var/plugins/ kopieren und mit "/var/plugins/record-lcd &" aufrufen
# Beenden ber "touch /tmp/lcd.stop"

remotebox="localhost"

wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?lock=1&clear=1"
while [ ! -e /tmp/lcd.stop ]; do
    MiBse1=`ifconfig eth0 | grep "TX packets" | cut -d ":" -f 2 |cut -d " " -f 1`
    MiBse1=`expr $MiBse1 \/ 10`
    sleep 1
    MiBse2=`ifconfig eth0 | grep "TX packets" | cut -d ":" -f 2 |cut -d " " -f 1`
    MiBse2=`expr $MiBse2 \/ 10`
    MiBse_diff=`expr $MiBse2 - $MiBse1`
    pos=`expr 10 + $MiBse_diff`
    #wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?rect=10,18,110,58,1,0&xpos=21&ypos=47&size=34&font=2&text=$MiBse_diff"
    wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?xpos=7&ypos=19&size=12&font=1&text===AUFNAHME=="
    wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?rect=7,25,110,50,1,0"
    wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?rect=7,25,$pos,50,1,1"
    wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?xpos=75&ypos=60&size=8&font=1&text=by Alex"
    wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?update=1"
    sleep 1
  done
  rm /tmp/lcd.stop
  wget -q -Y off -O /dev/null "http://$remotebox/control/lcd?lock=0&clear=1&update=1"
                                            
