From b7b6e103582f731cd935b929f25095443a10a860 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 9 Mar 2006 15:50:13 +0000 Subject: [PATCH] *** empty log message *** --- bin/pinggw | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/pinggw diff --git a/bin/pinggw b/bin/pinggw new file mode 100755 index 0000000..44d61be --- /dev/null +++ b/bin/pinggw @@ -0,0 +1,11 @@ +#!/bin/sh + +gateway=$( route -n | awk '/^0\.0\.0\.0[^0-9]/ {print $2; exit}' ) + +if [ -z "$gateway" ]; then + echo "Could not find default route via route -n:" >&2 + route -n >&2 + exit 1 +fi + +ping "$@" "$gateway"