From 4b2d62051e946edccf7393c6561b6c3a7a560d60 Mon Sep 17 00:00:00 2001 From: redhat27 Date: Sun, 26 Mar 2017 19:22:23 -0700 Subject: [PATCH] Accounted for newer nslookup output --- iblocklist-loader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iblocklist-loader.sh b/iblocklist-loader.sh index e7649b8..cf64c5c 100644 --- a/iblocklist-loader.sh +++ b/iblocklist-loader.sh @@ -191,7 +191,7 @@ if [ -s "$WHITELIST_DOMAINS_FILE" ]; then [ $? -eq 0 ] && entryCount=0 while read line; do if [ -n "${line%%#*}" ]; then - for ip in $(nslookup ${line%%#*} | sed -n '/^$/,$ s/^A.*: //p'); do + for ip in $(nslookup ${line%%#*} | sed -n '/^$/,$ s/^A.*: //p' | cut -d' ' -f1 | grep -v ":"); do ipset $ADD WhiteList $ip [ $? -eq 0 ] && entryCount=$((entryCount+1)) done