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