Linux updater
A single POSIX shell script (needs only curl) run every 2 minutes by a systemd timer, or by cron on systems without systemd. It is not a management agent: it does DDNS and nothing else.
Install
curl -fsSL https://docs.justasrv.com/downloads/install-linux.sh -o install-linux.sh
sudo sh install-linux.sh acme-main.ddns.justasrv.com
The installer asks for the token without echoing it. For unattended installs set JUSTASRV_TOKEN in the environment instead.
What it installs
/usr/local/bin/justasrv-update | the updater |
/etc/justasrv/justasrv.conf | hostname and token, mode 600 (root only) |
/var/lib/justasrv/state | last address, last success, backoff state |
justasrv-update.timer | runs the updater 30 s after boot and every 2 minutes |
How it behaves
- Each run asks
https://ddns.justasrv.com/ipfor the public address (one small request). - It sends an update only when the address changed, or every 10 minutes as a heartbeat. Heartbeats are answered
nochgand cause no DNS write. - After a failure it backs off exponentially (1, 2, 4… minutes up to an hour, plus jitter); rejected tokens back off 30 minutes. It recovers by itself when the network returns.
- The token is passed to curl on stdin, never on a command line, so it does not appear in
ps. - The config is re-read every run: after rotating a token, edit
TOKEN=in the config file and the next run uses it.
Operate
journalctl -t justasrv -n 20 # log
sudo /usr/local/bin/justasrv-update # run now
systemctl list-timers justasrv-update.timer
sudo sh install-linux.sh --uninstall
Download
| File | SHA-256 |
|---|---|
| justasrv-update.sh | babe653eddb3dc2ead8f37b9e55ac050429ec77597f0d9e47389ccaacd5e50ea |
| install-linux.sh | 06ccaea9fc6f2236e97f805c084db785499c5e414181d27caee15284fd2f053f |