diff --git a/wgtest b/wgtest new file mode 100644 index 0000000..64373a7 --- /dev/null +++ b/wgtest @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +USAGE="usage : wgtest ..." + +if [ $# -eq 0 ]; then + echo "$USAGE" + return +fi + +for host in $@; do + if ping -c 1 "$host" >/dev/null 2>/dev/null ; then + echo "$host : REACHABLE"; + else + echo "$host : UNREACHABLE"; + fi +done