network related script
script that pings hosts given as arguments to check reachability
This commit is contained in:
parent
968b5836f1
commit
d4a4bcc185
1 changed files with 16 additions and 0 deletions
16
wgtest
Normal file
16
wgtest
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/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
|
||||||
Loading…
Reference in a new issue