Просмотр исходного кода

make noise while running the test if its not there

David 9 лет назад
Родитель
Сommit
765a500576
2 измененных файлов с 4 добавлено и 4 удалено
  1. 0 3
      make_noise.sh
  2. 4 1
      speedtest.sh

+ 0 - 3
make_noise.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-rm -f noise
-dd if=/dev/urandom bs=1M count=10 of=noise

+ 4 - 1
speedtest.sh

@@ -1,5 +1,8 @@
 #!/bin/bash
 #!/bin/bash
-
+set -euo pipefail
+if [ ! -f noise ]; then
+	dd if=/dev/urandom bs=1M count=10 of=noise 2>/dev/null
+fi
 size=$(du noise | awk '{ print $1 }')
 size=$(du noise | awk '{ print $1 }')
 start=$(date +%s)
 start=$(date +%s)
 ssh especificosba.com.ar "cat >/dev/null" < noise
 ssh especificosba.com.ar "cat >/dev/null" < noise