From 4e77f514a6947ae3e438e5b1b22c5ffb2b223065 Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 28 Apr 2024 11:32:38 +0300 Subject: [PATCH] blockcheck: windows compatible nslookup --- blockcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockcheck.sh b/blockcheck.sh index f257033..7ca9968 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -1383,7 +1383,7 @@ lookup4() # $2 - DNS case "$LOOKUP" in nslookup) - nslookup $1 $2 2>/dev/null | sed -n '/Name:/,$p' | sed -nre 's/^.*(([0-9]{1,3}\.){3}[0-9]{1,3}).*$/\1/p' + nslookup $1 $2 2>/dev/null | sed -e '1,3d' -nre 's/^[^0-9]*(([0-9]{1,3}\.){3}[0-9]{1,3}).*$/\1/p' ;; host) host -t A $1 $2 | grep "has address" | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}'