Last active
January 3, 2016 00:29
-
-
Save posva/8383074 to your computer and use it in GitHub Desktop.
typo
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 | |
# 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