Created
March 18, 2026 13:52
-
-
Save runbiscuit/12768887ef4583a7305d53cf74974461 to your computer and use it in GitHub Desktop.
Speedtest Script for Teltonika Routers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") | |
| RAW=$(echo 'y' | speedtest) | |
| # Extract last average download speed line | |
| DL_LINE=$(echo "$RAW" | grep "Average download speed" | tail -1) | |
| UL_LINE=$(echo "$RAW" | grep "Average upload speed" | tail -1) | |
| # Extract numeric value and unit | |
| DL_VAL=$(echo "$DL_LINE" | grep -oE '[0-9]+\.[0-9]+(kbps|mbps)') | |
| UL_VAL=$(echo "$UL_LINE" | grep -oE '[0-9]+\.[0-9]+(kbps|mbps)') | |
| # Send SMS with results | |
| gsmctl -S -s "<YOUR_NUMBER_HERE> Shipmunk $(date '+%Y-%m-%d') Speedtest @ 01:00 | DL: ${DL_VAL} UL: ${UL_VAL}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment