fixed duplication bug; swapped 'for' for 'while'

pull/5/head
Aaron Johnson 7 years ago
parent 753d1aa184
commit 21ad38ab24

@ -14,7 +14,7 @@ get_hostip () {
} }
zone_xfer=`dig $scan_domain @$scan_ns AXFR | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$4,$5}'` zone_xfer=`dig $scan_domain @$scan_ns AXFR | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$4,$5}'`
for host in `echo $zone_xfer | awk '{print $1}'`; do while read host <&3; do
user_name=$3 user_name=$3
connect_cmd="ssh -t" connect_cmd="ssh -t"
host_short=`echo ${host} | awk -F. '{print $1}'` host_short=`echo ${host} | awk -F. '{print $1}'`
@ -36,7 +36,7 @@ for host in `echo $zone_xfer | awk '{print $1}'`; do
get_hostip ${host} get_hostip ${host}
alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}" alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}"
fi >/dev/null fi >/dev/null
done done 3< <(echo $zone_xfer | awk '{print $1}' | uniq)
unset -f get_hostip unset -f get_hostip
return 0 return 0

Loading…
Cancel
Save