Commit 4912cebc authored by Peter Kovary's avatar Peter Kovary
Browse files

Merge branch 'accurate-progress' into 'master'

v1.7.8: Accurate progress

See merge request !18
parents 4f2c345e fa3420ce
......@@ -15,8 +15,7 @@ if [ ! -f ./.hosts ]; then
do
hostlist+=(`host $ip | awk '/pointer/ { print $5 }' | sed -e 's/\./ /g' | awk '{print $1}'`)
done
echo ${hostlist[*]} > ./.hosts
else
hostlist=(`cat ./.hosts`)
echo ${hostlist[*]} | sed -E 's/([^ ]*vm[^ ]* )|((cider|lexis)[0-9]{2} )//g' > ./.hosts
fi
hostlist=(`cat ./.hosts`)
echo ${hostlist[*]}
......@@ -9,7 +9,7 @@ hostlist=(`./gethosts`)
outputFile="whosinlabs_tmp-$(date +%Y-%m-%dT%H:%M:%S.%N)"
keep=false
version='1.7.7'
version='1.7.8'
sortBy="name"
......@@ -107,10 +107,12 @@ fi
# Create a temp file for appending records
echo > $outputFile
HOST_COUNT=$(wc -w .hosts | cut -d ' ' -f 1)
if [ -t 1 ]; then
timeout -k 1 $timeout bash -ce "
while true; do
printf 'Progress: %02d%%\r' \$(x=\$(grep '' -c "$outputFile")00; expr \$x / 480)
printf 'Progress: %02d%%\r' \$(x=\$(grep '' -c "$outputFile")00; expr \$x / $HOST_COUNT)
done" &
fi
......
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