feat: 增加服务端和主程序启动命令
This commit is contained in:
32
btl_ctl.sh
32
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
|
||||
|
||||
Reference in New Issue
Block a user