#!/bin/sh echo Content-type: text/html echo cat< $(/bin/hostname) - Status: OLSR EOF eval $(awk 'sub(":","") {if (!($1~/wifi/)) {i++;print "WDEV"i"="$1}}' /proc/net/wireless) cat<HomeVerwalten    
Inhalt
EOF if [ -d /etc/pmacct ]; then cat<
EOF fi cat<
EOF if [ -n "$WDEV2" ]; then cat<
EOF fi cat<
EOF WLDEV=$WDEV1 if [ -n "$WDEV2" ] && ! iwconfig $WDEV2 2>/dev/null|grep -q Mode:Master; then WLDEV=$WDEV2 fi if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ "$QUERY_STRING" != "${QUERY_STRING#*post_olsr=}" ]; then cat<Status: OLSR
         
 
EOF wget -q -O - http://127.0.0.1:8080/all|awk ' /

/, /<\/div>/ { gsub("border=0", "border=1 cellspacing=0 cellpadding=0") gsub("BORDER=0", "BORDER=1") gsub("

EOF elif [ "$QUERY_STRING" != "${QUERY_STRING#*post_route=}" ]; then cat<Status: Routen
", s); } function ip(s) { if(s!~/\.0$/) { td(sprintf("%s", s, s)); } else { td(s); } } BEGIN { print "<""TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">"; } /^[0-9]/ { printf ""; ip($1); ip($2); for(i=3;i<=NF;i++) td($i); printf "\n"; } /^Destination/ { printf ""; for(i=1;i<=NF;i++) printf("", $i); printf "\n"; } END { print "<""/TABLE>"; }' cat<
         
 
EOF route -n|awk ' function td(s) { printf("%s
%s
EOF elif [ "$QUERY_STRING" != "${QUERY_STRING#*post_scan=}" ]; then cat<Status: WLAN Scan
"; } /Address:/ { ssid=" " chan=" "; adhoc="no"; rssi="0"; titl=" "; wep="no"; rate=" "; bssid=$NF; do { if(!(getline)) break; if (/ESSID:/) { ssid=gensub("^[^:]+:\"?", "", $NF); gsub("\"$", "", ssid); } if (/Frequency:/) { chan=gensub("^[^:]+:", "", $NF); } if (/Mode:/) { adhoc=($NF~/Ad-Hoc/?"yes":"no"); } if (/Quality:/) { titl=$0; gsub("^[ ]+", "", titl); sig=$3; gsub("^[^:]+:", "", sig); noi=$6; gsub("^[^:]+:", "", noi); rssi=int((sig-noi)/4); if (0 > rssi) rssi = 0; if (5 < rssi) rssi = 5; } if (/Encryption key:/) { if ($NF~/:on$/) wep="yes"; } if (/Bit Rate:/) { rate=gensub("^[^:]+:", "", $NF); } } while(!/Extra:/); print "" print "" print "" print "" print "" print "" print "" print "" print ""; } END { print "
         
 
SSID Kanal Ad Hoc Signal WEP Max. BSSID
EOF iwlist $WLDEV scanning 2>/dev/null|awk ' BEGIN { print "
"ssid""chan"\""adhoc"\"\""wep"\""rate""bssid"
 " }' cat<
EOF else cat<Status: Übersicht
[^>]+", "") sub("
         
 
IP Adresse: IP: $(ifconfig $WLDEV|awk 'sub("inet addr:","") {print $1}'), Maske: $(ifconfig $WLDEV|awk 'sub("Mask:","") {print $4}'), MAC: $(ifconfig $WLDEV|awk 'sub("HWaddr","") {print $4}')
WLAN Status: $(iwconfig $WLDEV 2>/dev/null|sed -e "s/\(Tx-Power:\)[0-9]\+/\1XXX/g")
Gerätelaufzeit: $(uptime)
Nachbarn: EOF wget -q -O - http://127.0.0.1:8080/nodes|awk ' /

/,/<\/div>/ { if ($1~/

/) { prnt=($1~/Links/) } else if (prnt) { sub("<""table[^>]+>", "<""table frame=void border=1 cellspacing=0 cellpadding=1 width=100%>") sub("

remote IP", "IP") sub(":8080/all", "/cgi-bin-status.html") print } }' cat<
EOF fi cat<
Stand: 17.12.2006
Seitenanfang EOF