Merge: + DNS: use rules from /etc/hosts
- fix filtering logic: don't do DNS response check for Rewrite rules
Close #1478
Squashed commit of the following:
commit 1206b94881289ff664b7c8998ea97c1455da1ff8
Merge: c462577a 5fe98474
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Mar 20 15:00:25 2020 +0300
Merge remote-tracking branch 'origin/master' into 1478-auto-records
commit c462577ad84754f5b3ea4cd58339838af817fe36
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Mar 20 14:33:17 2020 +0300
minor
commit 7e824ba5f432648a976bc4b8076a645ba875ef70
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Mar 20 14:29:54 2020 +0300
more tests
commit a22b62136c5cfd84cd0450897aef9e7d2e20585a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Mar 20 14:09:52 2020 +0300
rename, move
commit 9e5ed49ad3c27c57d540edf18b78d29e56afb067
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Mar 19 15:33:27 2020 +0300
fix logic - don't do DNS response check for Rewrite rules
commit 6cfabc0348a41883b8bba834626a7e8760b76bf2
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Mar 19 11:35:07 2020 +0300
minor
commit 4540aed9327566078e5087d43c30f4e8bffab7b9
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Mar 19 11:03:24 2020 +0300
fix
commit 9ddddf7bded812da48613cc07084e360c15ddd0e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Mar 19 10:49:13 2020 +0300
fix
commit c5f8ef745b6f2a768be8a2ab23ad80b01b0aa54f
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Mar 19 10:37:26 2020 +0300
fix
commit f4be00947bf0528c9a7cd4f09c4090db444c4694
Author: Simon Zolin <s.zolin@adguard.com>
Date: Mon Mar 16 20:13:00 2020 +0300
+ auto DNS records from /etc/hosts
This commit is contained in:
@@ -196,7 +196,7 @@ func handleServiceInstallCommand(s service.Service) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if isOpenWrt() {
|
||||
if util.IsOpenWrt() {
|
||||
// On OpenWrt it is important to run enable after the service installation
|
||||
// Otherwise, the service won't start on the system startup
|
||||
_, err := runInitdCommand("enable")
|
||||
@@ -223,7 +223,7 @@ Click on the link below and follow the Installation Wizard steps to finish setup
|
||||
|
||||
// handleServiceStatusCommand handles service "uninstall" command
|
||||
func handleServiceUninstallCommand(s service.Service) {
|
||||
if isOpenWrt() {
|
||||
if util.IsOpenWrt() {
|
||||
// On OpenWrt it is important to run disable command first
|
||||
// as it will remove the symlink
|
||||
_, err := runInitdCommand("disable")
|
||||
@@ -270,7 +270,7 @@ func configureService(c *service.Config) {
|
||||
c.Option["SysvScript"] = sysvScript
|
||||
|
||||
// On OpenWrt we're using a different type of sysvScript
|
||||
if isOpenWrt() {
|
||||
if util.IsOpenWrt() {
|
||||
c.Option["SysvScript"] = openWrtScript
|
||||
}
|
||||
}
|
||||
@@ -283,20 +283,6 @@ func runInitdCommand(action string) (int, error) {
|
||||
return code, err
|
||||
}
|
||||
|
||||
// isOpenWrt checks if OS is OpenWRT
|
||||
func isOpenWrt() bool {
|
||||
if runtime.GOOS != "linux" {
|
||||
return false
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadFile("/etc/os-release")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return strings.Contains(string(body), "OpenWrt")
|
||||
}
|
||||
|
||||
// Basically the same template as the one defined in github.com/kardianos/service
|
||||
// but with two additional keys - StandardOutPath and StandardErrorPath
|
||||
var launchdConfig = `<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
Reference in New Issue
Block a user