diff --git a/updateHostsFile.py b/updateHostsFile.py index 8eaff1717..a2f09ebd9 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -1306,6 +1306,9 @@ def flush_dns_cache(): ) if os.path.isfile(service_file): + if 0 != subprocess.call([systemctl, "status", service], + stdout=subprocess.DEVNULL): + continue dns_cache_found = True if subprocess.call(SUDO + [systemctl, "restart", service]):