From c566fd1f6633f07e70be8db80039d76658a0ad40 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Thu, 2 Mar 2023 14:56:08 +0800 Subject: [PATCH] Update shell_execute.py --- appmanage/api/utils/shell_execute.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/appmanage/api/utils/shell_execute.py b/appmanage/api/utils/shell_execute.py index 4b71d52a..38c7ebbe 100644 --- a/appmanage/api/utils/shell_execute.py +++ b/appmanage/api/utils/shell_execute.py @@ -65,3 +65,12 @@ def execute_command_output_all(cmd_str, max_time = 3): excutetime = excutetime + 1 return {"code": "-1", "result": "command excute failed, please check your command!"} + +def convert_command(cmd_str): + convert_cmd = "" + if cmd_str == "": + convert_cmd=cmd_str + else: + convert_cmd='echo "'+cmd_str+'" > /hostpipe/appmanage' + + return convert_cmd