PhysicsCorrection/scripts/http_run.sh

32 lines
398 B
Bash

#!/bin/bash
set -e
# 导出环境变量
WORK_DIR="${COZE_WORKSPACE_PATH:-.}"
PORT=8000
usage() {
echo "用法: $0 -p <端口>"
}
while getopts "p:h" opt; do
case "$opt" in
p)
PORT="$OPTARG"
;;
h)
usage
exit 0
;;
\?)
echo "无效选项: -$OPTARG"
usage
exit 1
;;
esac
done
python ${WORK_DIR}/src/main.py -m http -p $PORT