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"]
|
2023-12-02 13:22:57 +08:00
|
|
|
|
2023-12-02 10:53:31 +08:00
|
|
|
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)
|