Documentation
¶
Overview ¶
Package bootscript generates the on_boot.d script for UniFi Dream devices. A single script file at /data/on_boot.d/20-dddns.sh selects between the two run modes (cron, serve); `dddns config set-mode` writes the output of Generate into that path.
Serve mode uses a systemd unit (standard on UniFi OS 2.x+) for supervision; cron mode installs an /etc/cron.d entry. Both artefacts live outside /data (they're on the wiped-by-firmware root FS), so the boot script re-installs them on every boot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Params ¶
type Params struct {
Mode string // "cron" or "serve"
BinaryPath string // e.g. /data/dddns/dddns
ConfigDir string // e.g. /data/.dddns
CronEntryPath string // e.g. /etc/cron.d/dddns
UpdateInterval string // crontab schedule; e.g. "*/30 * * * *"
}
Params carries the paths embedded into the generated script. Callers typically pass DefaultUnifiParams; tests exercise alternative values.
func DefaultUnifiParams ¶
DefaultUnifiParams returns the path defaults for a UniFi install. UpdateInterval is intentionally left blank — the caller is responsible for populating it (typically via config.UpdateIntervalOrDefault). This keeps the cron schedule's source of truth in the config package rather than duplicating the string literal here.