Check if a service is running (Fixed #1337)

This commit is contained in:
Max G 2020-07-10 22:47:47 +03:00
parent c2ebad946e
commit 43fe30181b

View File

@ -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]):