Created
May 16, 2014 17:00
-
-
Save RichardHum/d86caf2cd7fdbf67a4c1 to your computer and use it in GitHub Desktop.
Lists the IP addresses a specified client is connected to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is for DD-WRT | |
# This script lists the IP addresses that a specified client is connected to. | |
echo -n "Username: " | |
read username | |
echo -n "Password: " | |
stty -echo | |
read password | |
stty echo | |
while true | |
do | |
echo -en "\nIP Address: " | |
read ipaddr | |
curl -u ${username}:${password} http://192.168.1.1/Status_Conntrack.asp 2> /dev/null | sed -e :a -e 's/<[^>]*>/\ /g;/</N;//ba' | grep "$ipaddr" | awk '{print $6"\t"$5}' | grep -v 192.168.* | while read line; do echo -en "$line \t"; nslookup `echo $line | awk '{print $2}'` | grep "name\ " | sed s/.*\=\ // | tr -d '\n'; echo -en '\n'; done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment