This script mirrors the [AREDN firmware repository](https://downloads.arednmesh.org/), patches the firmware site config to use a local mesh URL, and regenerates JSON indexes. See [Creating a Local AREDN® Software Server](https://docs.arednmesh.org/en/latest/arednHow-toGuides/local-software-source.html).
This script was designed for use **Disaster Response Communications & Information Technology (DRCIT)** but is freely reusable by other hams/groups.
---
## 🚀 Quick Start (5 minutes)
```bash
# 1. Clone this repo
git clone https://drcit.dev/DRCIT/aredn.git
cd aredn
# 2. Edit sync.sh variables for your node
nano sync.sh # set ROOT, LOG, NEW_URL
# 3. Make it executable
chmod +x ~/.local/bin/sync.sh
# 4. Test once manually
~/.local/bin/sync.sh
# 5. Add cron (every 4 hours, as local user part of the docker group)
Done ✅ — your mirror will now stay up to date automatically. Replace <user><group> with actual user & group (usually drcit drcit) and any <paths> with the correct *absolute* path (e.g. "/**home/drcit**/.local/logs/aredn.log {")
---
## 🔧 How it works
1.**Sync**: runs `rsync` to mirror upstream firmware files into `$ROOT`.
2.**Patch**: replaces the default firmware URL in `afs/www/config.js` with your local mesh URL (`$NEW_URL`).
3.**Collect**: runs `afs/misc/collect.py` to regenerate JSON indexes.
4.**Log**: everything is written to `~/.local/logs/aredn.log`.
---
## ⚙️ Variables to Edit
At the top of `sync.sh`, adjust these for your environment: