update
This commit is contained in:
parent
516b9bdfed
commit
43c281546f
2
tool.py
2
tool.py
|
@ -23,7 +23,7 @@ def close_stream(client):
|
||||||
|
|
||||||
def exec_sh(msg, client):
|
def exec_sh(msg, client):
|
||||||
cmd = json.loads(msg.payload.decode('utf-8'))["data"]
|
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
|
return
|
||||||
p = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
|
|
Loading…
Reference in New Issue