From b9d4a1159130377db81c4c4d381f6248540ea26c Mon Sep 17 00:00:00 2001 From: MaffC Date: Mon, 4 Feb 2013 02:52:48 +0000 Subject: [PATCH] Added modified patch contributed by staticsafe to make nscheck a little more compatible --- nscheck.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nscheck.sh b/nscheck.sh index bbed837..fc21cba 100755 --- a/nscheck.sh +++ b/nscheck.sh @@ -1,4 +1,4 @@ -#!/usr/local/bin/bash +#!/usr/bin/env bash #nscheck.sh - Simple script to do fairly good DNS diagnostics, to determine: Failing/slow nameservers, result inconsistency and so on. # Copyright (c) 2012, Matthew Connelly @@ -18,7 +18,11 @@ TIMEOUT=1 #Binary locations -DIG_BIN="/usr/bin/dig" +DIG_BIN="$(command -v dig)" +if [ $? -ne 0 -o -z "$DIG_BIN" ]; then + echo "Error: 'dig' cannot be found. Please ensure you have the relevant package for 'dig' installed." + exit 1 +fi #Internal variables DIG_RECORD_TYPE="A"