25 lines
600 B
Bash
Executable File
25 lines
600 B
Bash
Executable File
#!/bin/bash
|
|
# Project restart script — called by /api/admin/restart-project
|
|
# 用法: bash restart_plantai_9000.sh [--port PORT]
|
|
# 从环境变量 PLANTAI_WEB_PORT 或参数获取端口,默认 9000
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
PORT="${PLANTAI_WEB_PORT:-9000}"
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--port|-p)
|
|
PORT="${2:?错误: --port 需要指定端口号}"
|
|
shift 2
|
|
;;
|
|
*)
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
cd "$SCRIPT_DIR"
|
|
exec bash manage_plantai.sh restart --port "$PORT"
|