Script examples

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:25, 29 July 2005 (edit)
213.139.154.67 (Talk)
(Which IPs and hostnames are used for wireless clients?)
← Previous diff
Revision as of 13:19, 29 July 2005 (edit) (undo)
213.139.154.67 (Talk)
(Which IPs and hostnames are used for wireless clients?)
Next diff →
Line 4: Line 4:
''Note: Only work if you get an IP from DHCP'' ''Note: Only work if you get an IP from DHCP''
- + mkdir /tmp/www
wl assoclist | awk '{print$2}' > /tmp/assocLIST wl assoclist | awk '{print$2}' > /tmp/assocLIST
while read assocLINE while read assocLINE
do do
 + # echo "<b>IPs and hostnames of WLAN clients</b> <p>"
dumpleases | grep -i $assocLINE | awk '{print "Hostname: " $1, "MAC: " $2, "IP: " $3}' dumpleases | grep -i $assocLINE | awk '{print "Hostname: " $1, "MAC: " $2, "IP: " $3}'
- done < /tmp/assocLIST+ done < /tmp/assocLIST # > /tmp/www/wlan.html
Output: Output:
Line 20: Line 21:
Output: Output:
tp 192.168.2.101 tp 192.168.2.101
 +
 +if you want to show this in a browser remove the ''#'' and use:
 +http://192.168.2.1/user/wlan.html

Revision as of 13:19, 29 July 2005

Contents


Which IPs and hostnames are used for wireless clients?

Note: Only work if you get an IP from DHCP

mkdir /tmp/www
wl assoclist | awk '{print$2}' > /tmp/assocLIST
while read assocLINE
 do
# echo "IPs and hostnames of WLAN clients

" dumpleases | grep -i $assocLINE | awk '{print "Hostname: " $1, "MAC: " $2, "IP: " $3}' done < /tmp/assocLIST # > /tmp/www/wlan.html Output: 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 if you want to show this in a browser remove the # and use: http://192.168.2.1/user/wlan.html