fix restart

This commit is contained in:
Lurkars 2022-02-13 12:09:17 +01:00
parent b8d39e41a3
commit 284b8e5d3b

View File

@ -130,6 +130,7 @@ class Luniebox(object):
if restart:
subprocess.run(["sudo", "systemctl", "restart", "spotifyd"])
time.sleep(20)
tries = 0
spotifyd_status = subprocess.call(
@ -137,7 +138,7 @@ class Luniebox(object):
while spotifyd_status != 0 and tries < max_tries:
subprocess.call(["systemctl", "restart", "spotifyd"])
tries += 1
tries = tries + 1
time.sleep(10 * tries)
spotifyd_status = subprocess.call(
["systemctl", "is-active", "--quiet", "spotifyd"])