This commit is contained in:
蒋小陌 2024-10-13 16:24:53 +08:00
parent e312733d66
commit eb911d0654

View File

@ -28,13 +28,19 @@ else
echo "端口 $PORT 未被占用"
fi
# 检查 Node.js 是否安装
if ! command -v node &> /dev/null; then
echo "Node.js 未安装,请先安装 Node.js。"
exit 1
fi
# 下载 index.js 并执行
echo "正在下载 index.js..."
curl -o $FILE https://x-mo.cn:9009/XiaoMo/alist-proxy/raw/branch/master/index.js
if [ $? -eq 0 ]; then
echo "下载完成,正在执行 $FILE..."
node $FILE port=$PORT
PORT=$PORT node $FILE # 传递端口作为环境变量
else
echo "下载失败"
fi