Skip to content

Instantly share code, notes, and snippets.

@runbiscuit
Created March 18, 2026 13:52
Show Gist options
  • Select an option

  • Save runbiscuit/12768887ef4583a7305d53cf74974461 to your computer and use it in GitHub Desktop.

Select an option

Save runbiscuit/12768887ef4583a7305d53cf74974461 to your computer and use it in GitHub Desktop.
Speedtest Script for Teltonika Routers
#!/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