I have a wlan router in my LAN where I switched of the WLAN functionality because I have a faster one. Today I wanted to get access to the admin interface of the router. The problem was I forgot the ip adress of the router.
So I’m trying to write a little script which pings all hosts in my ip range and prints out the ip if the host exists.
I came up with this:
> for i in $(seq 1 255); do
> ping -c 1 -q -t 1 192.168.0.$i | grep -A1 -B1 ” 0%” | head -n1