commit 9bf2d574813d4fedabbbc055c41e19a080229493
parent 77e02f9f9066bd97390ddfa9d4391b934d347b62
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Sat, 17 Feb 2024 07:48:14 -0800
Add ifonline script
Checks whether you can ping the given address or a.root-servers.net.
Meant for certain cronjobs.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/local/bin/bin/ifonline b/local/bin/bin/ifonline
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Jacob R. Edwards 2024
+
+ping -w4 -c1 -q "${1:-a.root-servers.net}" >/dev/null 2>&1