Pull request: home: imp init

Merge in DNS/adguard-home from fix-init to master

Squashed commit of the following:

commit 551c143f6c3846f061b3118a06e1c756bc3e2ba1
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Feb 15 13:45:06 2021 +0300

    home: imp init
This commit is contained in:
Ainar Garipov 2021-02-15 14:20:23 +03:00
parent 7d1ca48ae4
commit aebcd74efe
2 changed files with 6 additions and 5 deletions

View File

@ -28,6 +28,7 @@ and this project adheres to
### Fixed ### Fixed
- Occasional crashes during startup.
- The field `"range_start"` in the `GET /control/dhcp/status` HTTP API response - The field `"range_start"` in the `GET /control/dhcp/status` HTTP API response
is now correctly named again ([#2678]). is now correctly named again ([#2678]).
- DHCPv6 server's `ra_slaac_only` and `ra_allow_slaac` settings aren't reset to - DHCPv6 server's `ra_slaac_only` and `ra_allow_slaac` settings aren't reset to

View File

@ -304,6 +304,11 @@ func run(args options) {
log.Fatalf("Can't initialize Web module") log.Fatalf("Can't initialize Web module")
} }
Context.ipDetector, err = newIPDetector()
if err != nil {
log.Fatal(err)
}
if !Context.firstRun { if !Context.firstRun {
err := initDNSServer() err := initDNSServer()
if err != nil { if err != nil {
@ -324,11 +329,6 @@ func run(args options) {
} }
} }
Context.ipDetector, err = newIPDetector()
if err != nil {
log.Fatal(err)
}
Context.web.Start() Context.web.Start()
// wait indefinitely for other go-routines to complete their job // wait indefinitely for other go-routines to complete their job