Rearranged initial fetch of speed data

This commit is contained in:
2025-12-07 19:04:06 -08:00
parent 925e640aad
commit 4d3d1c0594

View File

@@ -16,10 +16,6 @@ touch /var/www/data/speed/raw.speedtest.json
chown -R root:root /var/www/data || true chown -R root:root /var/www/data || true
chmod -R a+rwX /var/www/data || true chmod -R a+rwX /var/www/data || true
# Run the initial speed test once (in background) to populate files if possible
# We run it in background so server starts promptly. The cron will run hourly.
/usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1 || true &
# Ensure the cron job exists in Cron # Ensure the cron job exists in Cron
CRON_FILE=/etc/cron.d/speedtest-cron CRON_FILE=/etc/cron.d/speedtest-cron
if [ -f ${CRON_FILE} ] && grep run_speed_test ${CRON_FILE}; then if [ -f ${CRON_FILE} ] && grep run_speed_test ${CRON_FILE}; then
@@ -31,6 +27,10 @@ fi
# Start Debian cron in background # Start Debian cron in background
service cron start || cron || true service cron start || cron || true
# Run the initial speed test once (in background) to populate files if possible
# We run it in background so server starts promptly. The cron will run hourly.
/usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1 || true &
# Start busybox httpd serving /var/www on configured port in foreground # Start busybox httpd serving /var/www on configured port in foreground
if command -v busybox >/dev/null 2>&1; then if command -v busybox >/dev/null 2>&1; then
echo "starting busybox httpd on port ${PORT} serving /var/www" echo "starting busybox httpd on port ${PORT} serving /var/www"