Badb0y
Badb0y

Reputation: 351

Ping until cannot ping anymore

I want to measure how long it takes to finish this part of the script like this:

startdelete=`date +%s`
for i in $(nova list --all-tenants|grep spawningtest|awk '{print $2}')
        do nova delete $i
done &>/dev/null    

enddelete=`date +%s`
deletetime=$((enddelete-startdelete))
echo $deletetime > /var/tmp/lindeletetime

I have 2 questions:

  1. How can I measure actually "the do nova delete $i;done" part?
  2. How can I do the ping until it is not possible to ping anymore? The finish date should be when it is not possible to ping anymore.

Upvotes: 0

Views: 67

Answers (1)

Badb0y
Badb0y

Reputation: 351

2nd part should be this I think:

while ping -c1 10.104.202.207;do sleep 1;done

Upvotes: 1

Related Questions