Remove obsoleted dnscache service check
This commit is contained in:
@@ -3,9 +3,6 @@ package interception
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/safing/portbase/log"
|
|
||||||
"github.com/safing/portbase/notifications"
|
|
||||||
"github.com/safing/portbase/utils/osdetail"
|
|
||||||
"github.com/safing/portmaster/firewall/interception/windowskext"
|
"github.com/safing/portmaster/firewall/interception/windowskext"
|
||||||
"github.com/safing/portmaster/network/packet"
|
"github.com/safing/portmaster/network/packet"
|
||||||
"github.com/safing/portmaster/updates"
|
"github.com/safing/portmaster/updates"
|
||||||
@@ -33,7 +30,6 @@ func start(ch chan packet.Packet) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go windowskext.Handler(ch)
|
go windowskext.Handler(ch)
|
||||||
go checkWindowsDNSCache()
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -42,28 +38,3 @@ func start(ch chan packet.Packet) error {
|
|||||||
func stop() error {
|
func stop() error {
|
||||||
return windowskext.Stop()
|
return windowskext.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkWindowsDNSCache() {
|
|
||||||
status, err := osdetail.GetServiceStatus("dnscache")
|
|
||||||
if err != nil {
|
|
||||||
log.Warningf("firewall/interception: failed to check status of Windows DNS-Client: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if status == osdetail.StatusStopped {
|
|
||||||
err := osdetail.EnableDNSCache()
|
|
||||||
if err != nil {
|
|
||||||
log.Warningf("firewall/interception: failed to enable Windows Service \"DNS Client\" (dnscache): %s", err)
|
|
||||||
} else {
|
|
||||||
log.Warningf("firewall/interception: successfully enabled the dnscache")
|
|
||||||
notifyRebootRequired()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func notifyRebootRequired() {
|
|
||||||
(¬ifications.Notification{
|
|
||||||
EventID: "interception:windows-dnscache-reboot-required",
|
|
||||||
Message: "Please restart your system to complete Portmaster integration.",
|
|
||||||
Type: notifications.Warning,
|
|
||||||
}).Save()
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user