From d4a4bcc185979c4fabfd457cbf4044c1553a94ed Mon Sep 17 00:00:00 2001 From: turbine Date: Thu, 20 Nov 2025 04:52:18 +0100 Subject: [PATCH] network related script script that pings hosts given as arguments to check reachability --- wgtest | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 wgtest 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