Skip to content

Instantly share code, notes, and snippets.

@muhamad-ridwant-tech
Created October 12, 2023 05:27
Show Gist options
  • Save muhamad-ridwant-tech/60923701090362710b71a425216ccf64 to your computer and use it in GitHub Desktop.
Save muhamad-ridwant-tech/60923701090362710b71a425216ccf64 to your computer and use it in GitHub Desktop.
multiple ping with bash
#!/bin/bash
# ping
echo " "
echo Mengirim Ping !
echo "Tanggal : $(date)"
echo " "
cat node.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