Änderungen

549 Bytes hinzugefügt ,  10:49, 10. Nov. 2006
Zeile 72: Zeile 72:  
         echo "cgi-bin-speed?r          - Ausgabe der bisher generierten Resultate"
 
         echo "cgi-bin-speed?r          - Ausgabe der bisher generierten Resultate"
 
         echo
 
         echo
         echo "\$VER 0.1 - 2006okt7 - bastian bittorf - weimarnetz.de"
+
         echo "\$VER 0.2 - 2006nov10 - bastian bittorf - weimarnetz.de"
 
         exit
 
         exit
 
fi
 
fi
Zeile 93: Zeile 93:  
IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $*
 
IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $*
 
WIFI_IP=$(nvram get wifi_ipaddr)
 
WIFI_IP=$(nvram get wifi_ipaddr)
 +
WIFI_IF=$(nvram get wifi_ifname)
 +
 +
test -z $METRIK1 && METRIK1=$(ip route|grep "$n dev $WIFI_IF  scope"|cut -d' ' -f9)
 +
test -z $METRIK1 && METRIK1=$(ip route|grep "$n"|cut -d' ' -f8)
    
iptables -I INPUT -p tcp -s $n -d $WIFI_IP --sport 80 -j ACCEPT
 
iptables -I INPUT -p tcp -s $n -d $WIFI_IP --sport 80 -j ACCEPT
Zeile 99: Zeile 103:  
killall wget
 
killall wget
   −
ERGEBNIS=$(iptables -nxvL INPUT|grep $WIFI_IP)
+
test -z $METRIK2 && METRIK2=$(ip route|grep "$n dev eth1  scope"|cut -d' ' -f9)
 +
test -z $METRIK2 && METRIK2=$(ip route|grep "$n"|cut -d' ' -f8)
 +
 
 +
RAW="$(iptables -nxvL INPUT|grep $WIFI_IP)"
 +
KB=$(echo $RAW|while read A B A;do let d=B/10/1024;echo $d;done)
 +
ERGEBNIS="$KB $METRIK1 $METRIK2 $RAW"
 
iptables -D INPUT -p tcp -s $n -d $WIFI_IP --sport 80 -j ACCEPT
 
iptables -D INPUT -p tcp -s $n -d $WIFI_IP --sport 80 -j ACCEPT
 +
 +
echo "Kilobyte/s | Metrik vorher | nachher | Pakete | Bytes | Testnachbar | Testrouter - 10 Sekunden Testdownload"
 +
echo
 
echo "$ERGEBNIS"
 
echo "$ERGEBNIS"
 
echo >>$FILE "$ERGEBNIS"
 
echo >>$FILE "$ERGEBNIS"