sysadmin_scripts/wgtest
turbine d4a4bcc185 network related script
script that pings hosts given as arguments to check reachability
2025-11-20 04:52:18 +01:00

16 lines
253 B
Bash

#!/usr/bin/env sh
USAGE="usage : wgtest <IP address> ..."
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