Skip to content

Instantly share code, notes, and snippets.

@leewin12
Created August 19, 2016 08:30
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 leewin12/b81ed908238536f985c83d6728b012c6 to your computer and use it in GitHub Desktop.
Save leewin12/b81ed908238536f985c83d6728b012c6 to your computer and use it in GitHub Desktop.
check dead ip(or hostname) using shell ping
# !/bin/bash
# ips: ip list file
# ./find_dead.sh > dead.log
# cat dead.log | grep -v ttl | awk '{ print $1 }'
IPS=`cat ips`
for i in $IPS; do
CODE=`ping -c 1 $i `
echo $i $CODE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment