Skip to content

Instantly share code, notes, and snippets.

@davidcrx
Created March 21, 2018 11: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 davidcrx/bef2e15f336eab204bcfb524e04577e8 to your computer and use it in GitHub Desktop.
Save davidcrx/bef2e15f336eab204bcfb524e04577e8 to your computer and use it in GitHub Desktop.
Programa que comprueba si los hosts estan disponibles (mediante ping)
#Programa que comprueba si los hosts estan disponibles (mediante ping)
date
cat /home/davidcrx/list.txt | while read output
do
ping -c 1 "$output" > /dev/null
if [ $? -eq 0 ]; then
echo "node $output is up"
#dialog --msgbox "Todo correcto" 10 20
else
echo "node $output is down"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment