speedtest.sh 304 B

123456789
  1. #!/bin/bash
  2. size=$(du noise | awk '{ print $1 }')
  3. start=$(date +%s)
  4. ssh especificosba.com.ar "cat >/dev/null" < noise
  5. finish=$(date +%s)
  6. kbps=$(echo "scale=2; ($size)/($finish-$start)" | bc)
  7. curl -s -i -XPOST 'http://graphs.eba:8086/write?db=curso' --data-binary "speed,type=up value=$kbps" >/dev/null