Pull request: home: rm var shadowing, vol. 4

Closes #2803.

Squashed commit of the following:

commit cb36cc8811160bb39a32fb8eddf962d0ebe9035a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Mar 12 14:21:46 2021 +0300

    home: imp more

commit 9ea7ccec8bb293881cf724d7ad57e6744243d8b9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Mar 12 13:58:10 2021 +0300

    all: imp naming, refactor http srv shutdown

commit f29221007c16fd3e7230bf2c1ac37b365f3e29aa
Merge: 2247c05b bfbf73f3
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Mar 12 13:35:17 2021 +0300

    Merge branch 'master' into 2803-shadow-4

commit 2247c05b5521346aaf362d81ccdd64fee31f1e6d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Jan 29 20:53:21 2021 +0300

    home: rm var shadowing, vol. 4
This commit is contained in:
Ainar Garipov
2021-03-12 14:32:08 +03:00
parent bfbf73f3cd
commit 7e64205d44
17 changed files with 195 additions and 169 deletions

View File

@@ -65,8 +65,9 @@ func (a *AutoHosts) Init(hostsFn string) {
a.hostsFn = hostsFn
}
if IsOpenWRT() {
a.hostsDirs = append(a.hostsDirs, "/tmp/hosts") // OpenWRT: "/tmp/hosts/dhcp.cfg01411c"
if IsOpenWrt() {
// OpenWrt: "/tmp/hosts/dhcp.cfg01411c".
a.hostsDirs = append(a.hostsDirs, "/tmp/hosts")
}
// Load hosts initially

View File

@@ -66,8 +66,8 @@ func SplitNext(str *string, splitBy byte) string {
return strings.TrimSpace(s)
}
// IsOpenWRT returns true if host OS is OpenWRT.
func IsOpenWRT() bool {
// IsOpenWrt returns true if host OS is OpenWrt.
func IsOpenWrt() bool {
if runtime.GOOS != "linux" {
return false
}