Skip to content

Instantly share code, notes, and snippets.

@filiperfernandes
Created August 26, 2019 10:27
Show Gist options
  • Save filiperfernandes/6a02a424716432887160a6db5fae51ab to your computer and use it in GitHub Desktop.
Save filiperfernandes/6a02a424716432887160a6db5fae51ab to your computer and use it in GitHub Desktop.
Test Server conenctivity
#!/bin/bash
# Program name: pingall.sh
# Author: https://askubuntu.com/users/127327/souravc
# Source: https://askubuntu.com/questions/413367/ping-multiple-ips-using-bash
date
cat thesis-servers.txt | while read output
do
ping -c 1 "$output" > /dev/null
if [ $? -eq 0 ]; then
echo "node $output is up"
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