浏览代码

Update shell_execute.py

qiaofeng1227 2 年之前
父节点
当前提交
c566fd1f66
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      appmanage/api/utils/shell_execute.py

+ 9 - 0
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