Skip to content

Instantly share code, notes, and snippets.

@jrosco
Last active August 29, 2015 13:55
Show Gist options
  • Save jrosco/cbf66f335a4cdd75b504 to your computer and use it in GitHub Desktop.
Save jrosco/cbf66f335a4cdd75b504 to your computer and use it in GitHub Desktop.
Scan your network for a range of active ip adresses (change setting inside script)
#!/bin/bash
COUNT=0
MIN_IP_ADDRESS=1
CLASS=192.168.1
MAX_IP_ADDRESS=10
CONNECTION_TIMEOUT=1
HOSTNAME=$(hostname)
printf "_______________________________________________\n\n"
printf "Checking Alive IP Address's on $STORE_NAME\n"
printf "_______________________________________________\n\n"
while [ $MIN_IP_ADDRESS -lt $MAX_IP_ADDRESS ]; do
ping $CLASS.$MIN_IP_ADDRESS -w $CONNECTION_TIMEOUT >> /dev/null && printf "Ping $CLASS.$MIN_IP_ADDRESS\tAlive\n"
let COUNT=$COUNT+1
let MIN_IP_ADDRESS=MIN_IP_ADDRESS+1
done
printf "_______________________________________________\n\n"
printf "Found $COUNT IP Address on local LAN\n"
printf "_______________________________________________\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment