Here is script that can give the list of IP addresses and hostnames that are used for wireless clients
Note: Only work if you get an IP address from DHCP
SCRIPT :
Output:# mkdir -p /tmp/www
while [ 1 ];
do
wl assoclist | awk '{print tolower($2)}' > /tmp/assocLIST
# echo "<meta http-equiv="refresh" content="10"><b>Hostnames and IP addresses of WLAN clients</b> (last update: $(date))<p>" > /tmp/www/wlan.html
while read assocLINE
do
dumpleases | awk '/'"$assocLINE"'/ {print "Hostname: " $1, "MAC: " $2, "IP: " $3}'
# echo "<br>";
done < /tmp/assocLIST # >> /tmp/www/wlan.html
sleep 10;
done;
Hostname: tp MAC: 01:81:18:3d:49:5e IP: 192.168.2.101
You can change the order of "$1, $2, $3" or cut-out:... awk '{print $1,$3}'
Output:tp 192.168.2.101
A QUESTIONS FOR YOU :->
"How can I output the signal strength (wl rssi ) at the sametime by feeding MAC Addr from assoclist without typing MAC addr eachtime in telnet?"
Thanks...
0 comments:
Post a Comment