Verified Commit acc7b259 authored by Fangyi Zhou's avatar Fangyi Zhou
Browse files

Do not put hostname into array

parent 083062e8
......@@ -21,7 +21,7 @@ if [ ! -f "$hostsFile" ]; then
hostlist=()
for ip in ${iplist[*]}
do
hostname=(`host $ip | awk '/pointer/ { print $5 }' | sed -e 's/\./ /g' | awk '{print $1}'`)
hostname=$(host $ip | awk '/pointer/ { print $5 }' | sed -e 's/\./ /g' | awk '{print $1}')
if [[ "$hostname" =~ ^[a-z]+[0-9]{2}$ ]]
then
hostlist+=("$hostname")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment