AdGuard Home as a system service

1. Reworked working with command-line arguments
2. Added service control actions: install/uninstall/start/stop/status
3. Added log settings to the configuration file
4. Updated the README file
This commit is contained in:
Andrey Meshkov
2019-02-04 13:54:53 +03:00
parent b216475c20
commit 277415124e
8 changed files with 402 additions and 152 deletions

17
dhcp.go
View File

@@ -165,3 +165,20 @@ func startDHCPServer() error {
}
return nil
}
func stopDHCPServer() error {
if !config.DHCP.Enabled {
return nil
}
if !dhcpServer.Enabled {
return nil
}
err := dhcpServer.Stop()
if err != nil {
return errorx.Decorate(err, "Couldn't stop DHCP server")
}
return nil
}