Skip to content

Instantly share code, notes, and snippets.

@nobiit
Created September 12, 2021 12:09
Show Gist options
  • Save nobiit/fb51ecca750976db94dfc11b171718ec to your computer and use it in GitHub Desktop.
Save nobiit/fb51ecca750976db94dfc11b171718ec to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# set -ex
IP_SOURCE=${IP_SOURCE:-192.168.123.10}
for ip_address in 1.1.1.1 8.8.8.8 192.168.123.1 192.168.1.123 192.168.1.234 192.168.1.35 10.1.0.1 10.1.0.2 10.10.0.1 google.com one.one.one.one nobi.dev portainer.nobi.dev; do
result=$(ping -S ${IP_SOURCE} -c 1 -t 1 ${ip_address} >/dev/null && echo "OK" || echo "FAILED")
printf "%25s -> %s\n" ${ip_address} ${result}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment