Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.79 KB | None | 0 0
  1.     $(dd if=/dev/zero of=$test_file bs=$(echo "$test_size*1024" | bc) count=1 &> /dev/null)
  2.  
  3.     # upload test
  4.     # echo "Testing upload to $ssh_server..."
  5.     up_speed="$(scp -v $test_file $ssh_server:$test_file 2>&1 | grep "Bytes per second" | sed "s/^[^0-9]*\([0-9.]*\)[^0-9]*\([0-9.]*\).*$/\1/g")"
  6.     up_speed="$(echo "($up_speed*0.0009765625*100.0+0.5)/1*0.01" | bc)"
  7.  
  8.     # download test
  9.     # echo "Testing download to $ssh_server..."
  10.     down_speed="$(scp -v $ssh_server:$test_file $test_file 2>&1 | grep "Bytes per second" | sed "s/^[^0-9]*\([0-9.]*\)[^0-9]*\([0-9.]*\).*$/\2/g")"
  11.     down_speed="$(echo "($down_speed*0.0009765625*100.0+0.5)/1*0.01" | bc)"
  12.  
  13.     # clean up
  14.     # echo "Removing test file on $ssh_server..."
  15.     $(ssh $ssh_server "rm $test_file")
  16.     # echo "Removing test file locally..."
  17.     $(rm $test_file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement