diff --git a/start.sh b/start.sh index 1eb2d37..ebd49a6 100644 --- a/start.sh +++ b/start.sh @@ -16,10 +16,6 @@ touch /var/www/data/speed/raw.speedtest.json chown -R root:root /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 CRON_FILE=/etc/cron.d/speedtest-cron if [ -f ${CRON_FILE} ] && grep run_speed_test ${CRON_FILE}; then @@ -31,6 +27,10 @@ fi # Start Debian cron in background 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 if command -v busybox >/dev/null 2>&1; then echo "starting busybox httpd on port ${PORT} serving /var/www"