summaryrefslogtreecommitdiff
path: root/log.sh
diff options
context:
space:
mode:
authorSteph Enders <steph@senders.io>2023-12-22 14:23:50 -0500
committerSteph Enders <steph@senders.io>2023-12-22 14:23:50 -0500
commitee159acad5aab4ca25d749dfaced45f67831cfe6 (patch)
tree22050742502f46874f93475592a5b28943d0a413 /log.sh
parentc5d876faff7deef0506a9c7b2de3a169ca6c8e45 (diff)
Updated to use the speedtest-cli instead of pythonmain
Diffstat (limited to 'log.sh')
-rwxr-xr-xlog.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/log.sh b/log.sh
index 57ae19e..aa8b7bb 100755
--- a/log.sh
+++ b/log.sh
@@ -1,9 +1,6 @@
#!/usr/bin/env bash
-
+set -ex
WORKING_DIR=$(dirname $0)
-python3 -m venv $WORKING_DIR/.venv
-source $WORKING_DIR/.venv/bin/activate
-python3 -m pip install -I --disable-pip-version-check -r $WORKING_DIR/requirements.txt
if [[ $# -ne 1 ]]; then
OUTPUT=$WORKING_DIR/log.tsv
@@ -12,12 +9,13 @@ else
fi
if [[ ! -f $OUTPUT ]]; then
- speedtest-cli --csv-header | sed -E 's/,/\t/g' > $OUTPUT
-fi
-
-len=$(wc -l $OUTPUT | cut -d' ' -f1)
-if [[ $len -le 0 ]]; then
- speedtest-cli --csv-header | sed -E 's/,/\t/g' > $OUTPUT
+ ./speedtest-cli --output-header -f tsv > $OUTPUT
+else
+ len=$(wc -l $OUTPUT | cut -d' ' -f1)
+ if [[ $len -lt 1 ]]; then
+ ./speedtest-cli --output-header -f tsv > $OUTPUT
+ else
+ ./speedtest-cli -f tsv >> $OUTPUT
+ fi
fi
-speedtest-cli --csv-delimiter ' ' --csv >> $OUTPUT