2023-12-02 10:53:31 +08:00
|
|
|
import json
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
def push_stream():
|
|
|
|
subprocess.Popen(['/bin/bash start_push.sh'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
|
|
|
|
|
|
|
def close_stream():
|
|
|
|
subprocess.Popen(['/bin/bash stop_push.sh'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
|
|
|
|
|
|
|
def exec_sh(msg):
|
|
|
|
cmd = json.loads(msg.payload.decode('utf-8'))["data"]
|
|
|
|
subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
|
|
|
|
|
|
|
def update():
|
|
|
|
subprocess.Popen(['/bin/bash update.sh'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
2023-12-02 18:32:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
def get_record(msg):
|
|
|
|
time = json.loads(msg.payload.decode('utf-8'))["data"]
|