Skip to content

Instantly share code, notes, and snippets.

@posva
Last active January 3, 2016 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save posva/8383074 to your computer and use it in GitHub Desktop.
Save posva/8383074 to your computer and use it in GitHub Desktop.
typo
#! /bin/bash
# local-ping
# Simple script to check for reachable addresses in a local network
# Base IP for the local network. It an also be a 10.0.0 or anything else
BASE_IP=192.168.1.
# Wait time. Usually between 1 and 3
WAIT=2
# Number of packets to send
COUNT=3
ping_check() {
i=$1
if ping -c ${COUNT} -W ${WAIT} 192.168.1.${i} >/dev/null 2>/dev/null; then
echo -e "\e[32m192.168.1.${i} is available\e[0m"
fi
}
for i in `seq 1 254`; do
ping_check $i &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment