Files
openwrt-packages/net/netbird/files/netbird.init
Wesley Gimenes 95107af880 netbird: switch to profile-based configuration
Add support for `netbird` profiles feature [1] (introduced in 0.52.2). Use
`NB_STATE_DIR="/root/.config/netbird"` in the init file instead of the
previous `NB_CONFIG="/etc/netbird/config.json"`, and update Makefile
configuration paths accordingly.

Rationale: `netbird` saves state/configuration under `/var` by default. On
OpenWrt, `/var` is a symlink to `/tmp` (a volatile location), which would
cause config loss after reboot or reflash. Using `/root/.config/netbird`
avoids this, it's a valid upstream directory not used by default.
`netbird` will migrate existing configurations.

This change will not be backported to preserve the current meaning of
"stable" in OpenWrt and to avoid (unlikely but possible) breakage of
existing installations.

[1]: https://docs.netbird.io/how-to/profiles

Signed-off-by: Wesley Gimenes <wehagy@proton.me>
2025-09-10 19:09:49 -03:00

16 lines
306 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /usr/bin/netbird
procd_set_param env NB_STATE_DIR="/root/.config/netbird"
procd_append_param command service run
procd_set_param pidfile /var/run/netbird.pid
procd_close_instance
}