From 1a7817293638822dd97a81395a53a669e06345f9 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 16 May 2014 16:11:01 +0200 Subject: [PATCH] scan just one host per hostname --- top1m/testtop1m.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/top1m/testtop1m.sh b/top1m/testtop1m.sh index f12c10f..fb1a618 100755 --- a/top1m/testtop1m.sh +++ b/top1m/testtop1m.sh @@ -51,24 +51,24 @@ function scan_hostname() { if [ ! -z "$host_ips" ] && [ ! -z "$www_ips" ]; then # list of IPs that are in www but not in host local diff=$(grep -Fv "$host_ips" <<< "$www_ips") - while read ip; do + head -n 1 <<< "$host_ips" | while read ip; do scan_host $1 $ip - done <<< "$host_ips" + done if [ ! -z "$diff" ]; then - while read ip; do + head -n 1 <<<"$diff" | while read ip; do scan_host www.$1 $ip - done <<< "$diff" + done fi else if [ ! -z "$host_ips" ]; then - while read ip; do + head -n 1 <<<"$host_ips" | while read ip; do scan_host $1 $ip - done <<< "$host_ips" + done fi if [ ! -z "$www_ips" ]; then - while read ip; do + head -n 1 <<<"$www_ips" | while read ip; do scan_host www.$1 $ip - done <<< "$www_ips" + done fi fi }