Merge pull request #22211 from alaviss/adguard-network-wait
adguardhome: wait for interfaces to be up at boot
This commit is contained in:
commit
0577aa43d6
|
@ -4,12 +4,22 @@ PROG=/usr/bin/AdGuardHome
|
||||||
|
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
|
||||||
# starts just after network starts to avoid some network race conditions
|
# matches dnsmasq
|
||||||
START=25
|
START=19
|
||||||
# stops before networking stops
|
# stops before networking stops
|
||||||
STOP=89
|
STOP=89
|
||||||
|
|
||||||
|
boot() {
|
||||||
|
adguardhome_boot=1
|
||||||
|
start "$@"
|
||||||
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
|
if [ -n "$adguardhome_boot" ]; then
|
||||||
|
# Do not start yet, wait for triggers
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
config_load adguardhome
|
config_load adguardhome
|
||||||
config_get WORK_DIR config workdir
|
config_get WORK_DIR config workdir
|
||||||
|
|
||||||
|
@ -21,3 +31,11 @@ start_service() {
|
||||||
procd_set_param stderr 1
|
procd_set_param stderr 1
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service_triggers() {
|
||||||
|
if [ -n "$adguardhome_boot" ]; then
|
||||||
|
# Wait for interfaces to be up before starting AdGuard Home for real.
|
||||||
|
# Prevents issues like https://github.com/openwrt/packages/issues/21868.
|
||||||
|
procd_add_raw_trigger "interface.*.up" 5000 /etc/init.d/adguardhome restart
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue