#!/bin/bash

for i in {1..80}; do
    not_running=$(iperf3 -c 10.0.0.2 -d -t 10 -V | grep -Po '[0-9.]*(?= Mbits/sec)' | tail -n 1)
    echo $not_running >> speedtest_not_running.log
    echo "not running $not_running"
    ssh cfalas@10.0.0.2 "ssh root@10.0.12.64 'ping 192.168.55.3 -c 1100 -i 0.01'" > /dev/null &
    sleep 1s;
    running=$(iperf3 -c 10.0.0.2 -d -t 10 -V | grep -Po '[0-9.]*(?= Mbits/sec)' | tail -n 1)
    echo $running >> speedtest_running.log
    echo "running $running"
    sleep 1s;
done

wait
