diff --git a/tool.py b/tool.py index 40614f8..4ab6d9e 100644 --- a/tool.py +++ b/tool.py @@ -23,9 +23,9 @@ def close_stream(client): def exec_sh(msg, client): cmd = json.loads(msg.payload.decode('utf-8'))["data"] - if cmd == "supervisorctl stop __mqtt__": + if cmd == "supervisorctl stop __mqtt__" or cmd == "supervisorctl restart __mqtt__": return - if cmd == "supervisorctl restart __mqtt__" or cmd == "supervisorctl reload": + if cmd == "supervisorctl reload": subprocess.Popen([cmd], shell=True) return p = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)