From 564cb5a92d3293f79fbe0729f79c1ad42ae23772 Mon Sep 17 00:00:00 2001 From: bmy <2583236812@qq.com> Date: Sun, 16 Jun 2024 08:38:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF=E5=92=8C=E4=B8=BB=E7=A8=8B=E5=BA=8F=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- btl_ctl.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/btl_ctl.sh b/btl_ctl.sh index e69de29..a45bd6f 100644 --- a/btl_ctl.sh +++ b/btl_ctl.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +start() { + cd ~/Workplace/scripts + python start.py +} + +run() { + cd ~/Workplace/project_main/ + python main.py +} + +command_array=("start" "run") + +if [ $# -lt 1 ]; then + echo "请明确指令:" + for cmd in "${command_array[@]}"; do + echo "$cmd" + done + exit +else + if [[ $1 == "start" || $1 == "-start" || $1 == "START" ]]; then + start # 这里添加了调用start函数的代码 + elif [[ $1 == "run" || $1 == "-run" || $1 == "RUN" ]]; then + run # 假设你希望在这里调用run函数 + elif [[ $1 == "help" || $1 == "-help" || $1 == "HELP" ]]; then + echo "start: 启动服务端脚本" + echo "run: 启动任务主程序脚本" + else + echo "无效的指令:$1" + fi +fi