diff --git a/MQTT.py b/MQTT.py index f25f625..863f190 100644 --- a/MQTT.py +++ b/MQTT.py @@ -55,6 +55,9 @@ class MQTTClient: elif data == "update": # git更新项目和配置文件 update(client) + elif data == "update": + # git更新项目和配置文件 + reload(client) elif data == "record_list": # 查看录像列表 get_list_record() diff --git a/tool.py b/tool.py index 37413e8..8466962 100755 --- a/tool.py +++ b/tool.py @@ -65,6 +65,11 @@ def update(client): client.publish('success', payload=json.dumps(output, ensure_ascii=False), qos=0) +def reload(client): + subprocess.Popen(['supervisorctl reload'], shell=True) + client.publish('success', payload="reloading", qos=0) + + def get_list_record(): data = { "data": os.listdir(mp4_path)