mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-07-07 13:02:27 +02:00
Check if a service is running (Fixed #1337)
This commit is contained in:
parent
c2ebad946e
commit
43fe30181b
@ -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]):
|
||||
|
Loading…
Reference in New Issue
Block a user