Remove obsoleted dnscache service check

This commit is contained in:
Daniel 2021-05-05 00:24:44 +02:00
parent 48b55a88bc
commit fa58de2e1b

View file

@ -3,9 +3,6 @@ package interception
import (
"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/network/packet"
"github.com/safing/portmaster/updates"
@ -33,7 +30,6 @@ func start(ch chan packet.Packet) error {
}
go windowskext.Handler(ch)
go checkWindowsDNSCache()
return nil
}
@ -42,28 +38,3 @@ func start(ch chan packet.Packet) error {
func stop() error {
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() {
(&notifications.Notification{
EventID: "interception:windows-dnscache-reboot-required",
Message: "Please restart your system to complete Portmaster integration.",
Type: notifications.Warning,
}).Save()
}