Added speedlog.sh script

This commit is contained in:
0xFEEDC0DE64
2018-05-03 09:19:38 +02:00
parent 83db12d41d
commit b9dcbad2f1

12
speedlog.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
TIMESTAMP="$(date '+%Y-%m-%d_%H:%M:%S')"
SPEEDTEST_OUTPUT="$(speedtest)"
HOSTER="$(echo "$SPEEDTEST_OUTPUT" | grep -Po 'Hosted by \K[^[]*')"
PING_TIME="$(echo "$SPEEDTEST_OUTPUT" | grep -Po '\]: \K.*')"
DOWNLOAD="$(echo "$SPEEDTEST_OUTPUT" | grep -Po 'Download: \K.*')"
UPLOAD="$(echo "$SPEEDTEST_OUTPUT" | grep -Po 'Upload: \K.*')"
printf "%-21s %-40s %10s %14s %14s\n" "$TIMESTAMP" "$HOSTER" "$PING_TIME" "$DOWNLOAD" "$UPLOAD" | tee -a speedlog.txt