Skip to main content

Automated Edge Updater (updater.sh)

📌 What is this for? (Quick Summary for New Interns)​

In Simple Words:
When the Raspberry Pi is bolted inside a pod running on a test track in a remote facility, you cannot easily walk over with a keyboard and monitor every time you push a bug fix to GitHub.

This small script solves that:

  • Every 60 seconds, it checks GitHub (git fetch origin main).
  • If you pushed new code, it automatically pulls the latest changes, recompiles the Go server if needed, and restarts the background services.
  • You push to GitHub; the vehicle updates itself automatically.

1. How the Updater Works​


2. How to Check If It Is Working​

If you want to verify what the updater recently did on the Pi:

# View the last few lines of the updater log:
tail -n 25 ~/updater.log

# Check if the cron job is active:
crontab -l

If everything is nominal, you will see entries like:

[2026-11-03 12:11:12] 🚀 Services built, updated, and restarted successfully!