#!/bin/sh echo Content-type: text/html echo cat< London Wireless - Status: OLSR
HomeContact
 
 

Contents

EOF WLDEV=$(awk 'sub(":","") {print $1}' /proc/net/wireless) if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ -n "$QUERY_STRING" ]; then eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}') fi if [ -n "$post_olsr" ]; then cat<Status: OLSR
    EOF if [ "$(nvram get wl0_mode)" != "ap" ];then cat< EOF fi if [ "$(nvram get ff_httpinfo)" != "0" ];then cat< EOF fi cat<
 
EOF wget -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 [ -n "$post_route" ]; then cat<Status: Routes
", s); } function ip(s, m) { if(m=="255.255.255.255"&&s!="0.0.0.0") { td(sprintf("%s", s, s)); } else { td(s); } } BEGIN { print "<""TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">"; } /^[0-9]/ { printf ""; ip($1, $3); ip($2, $3); 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 if [ "$(nvram get wl0_mode)" != "ap" ];then cat< EOF fi if [ "$(nvram get ff_httpinfo)" != "0" ];then cat< EOF fi cat<
 
EOF route -n|awk ' function td(s) { printf("%s
%s
EOF elif [ -n "$post_scan" ]; then cat<Status: WLAN Scan
"; } /^SSID:/ { ssid=substr($2, 2, length($2) - 2); chan=" "; adhoc="no"; open="yes"; rssi="0"; titl=" "; rate=" "; bssid=" "; do { if(!(getline))break; if (/Channel:/) { chan=$NF; } if (/Mode:/) { adhoc=($2~/Managed/?"no":"yes"); } if (/RSSI:/) { rssi=int(($(4+($3~/Hoc/))-$(7+($3~/Hoc/)))/4); for(i=3; i<=8; i++) { titl=titl$(i+($3~/Hoc/))" "; } if (0 > rssi) rssi = 0; if (5 < rssi) rssi = 5; } if (/Capability:/) { for(i = 4; i <= NF; i++) { if ($i~/^WEP/) open="no"; } } if (/Supported Rates:/) { rate=$(NF - 1); } if (/BSSID:/) { bssid=$2; } } while(/\S/); print "" print "" print "" print "" print "" print "" print "" print "" print ""; } END { print "
    EOF if [ "$(nvram get wl0_mode)" != "ap" ];then cat< EOF fi if [ "$(nvram get ff_httpinfo)" != "0" ];then cat< EOF fi cat<
 
SSID Channel Ad-Hoc Open Signal Max. BSSID
EOF wl -i $WLDEV scan sleep 2 wl -i $WLDEV scanresults|awk ' BEGIN { print "
"ssid""chan"\""adhoc"\"\""open"\""rate""bssid"
 " }' cat<
EOF else cat<Status: Overview
    EOF if [ "$(nvram get wl0_mode)" != "ap" ];then cat< EOF fi if [ "$(nvram get ff_httpinfo)" != "0" ];then cat< EOF fi cat<
 
IP Address: IP: $(ifconfig $WLDEV|awk 'sub("inet addr:","") {print $1}'), Mask: $(ifconfig $WLDEV|awk 'sub("Mask:","") {print $4}'), MAC: $(ifconfig $WLDEV|awk 'sub("HWaddr","") {print $4}')
WLAN Status: EOF wl -i $WLDEV status 2>&1 cat<
Uptime: $(uptime)
Device Info: Boardtype: $(nvram get boardtype), Boardnum: $(nvram get boardnum)
Kernel Log: Show / Hide
EOF echo -n '' cat<
System Log: Show / Hide
EOF echo -n '' cat<
IP NAT: Show / Hide
EOF echo -n '' cat<
Interface Config: Show / Hide
EOF echo -n '' cat<
EOF if [ "00:90:96:00:00:00" = "$(nvram get et0macaddr)" ] || [ "00:90:96:00:00:02" = "$(nvram get il0macaddr)" ]; then cat< Warning: This SE505 device does not have the correct MAC address. Read the MAC address from the bottom of the device and correct manually on the command line shell, e.g. with nvram set et0macaddr=xx:xx:xx:xx:xx:xx, nvram set il0macaddr=xx:xx:xx:xx:xx:[xx+1], nvram commit and reboot

EOF fi fi cat<
Changed: 14.9.2005
Top of page
EOF