iperf_script_phone 690 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/bash

#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf arguments

args=($*)
timeout=${args[0]}
device_id=${args[1]}
iperf_args=(${args[@]:2})

#array=${1:-1}
echo "args =  ${args[@]}"
echo "timeout = $timeout"
echo "device_id = $device_id"
echo "iperf_args = ${iperf_args[@]}"

sleep $timeout

20 21 22
while true ; do
  cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
  if [ -z "$cmd" ]; then
23 24
     echo "Wating for UE to connect and get IP Address..."
     sleep 1
25 26 27
  else 
     echo "UE is not connected. IP Address settings are... $cmd"
     break
28
  fi
29 30 31 32
done

print "Starting iperf now..."

33
sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]}