#!/bin/sh
# Optional: run speedtest and append to log (for cron)
# Requires: apk add speedtest-cli
# Cron example: 0 */6 * * * /usr/local/bin/speedtest-5g.sh
# Rev: 1  (see REVISION in repo root)

LOG="/var/log/speedtest-5g.log"
if command -v speedtest-cli >/dev/null 2>&1; then
    echo "=== $(date -Iseconds) ===" >> "$LOG"
    speedtest-cli --simple >> "$LOG" 2>&1
    echo "" >> "$LOG"
else
    echo "$(date -Iseconds) speedtest-cli not installed" >> "$LOG"
fi
