Files
dock/GoEdge-cdn
2026-02-12 22:09:54 +08:00

39 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 1. 检测是否安装了 unzip如果没有则安装
if ! command -v unzip &> /dev/null; then
echo "未检测到 unzip正在安装..."
apt update && apt install -y unzip
else
echo "检测到 unzip 已安装。"
fi
# 2. 创建安装目录 (使用 GoEdge 默认目录)
INSTALL_DIR="/usr/local/goedge"
mkdir -p "$INSTALL_DIR"
# 3. 从你提供的链接下载安装包
# 注意:将其重命名为 edge-admin.zip 以便识别
DOWNLOAD_URL="https://git.vps3344521.xyz/3344/dock/releases/download/Goedge-cdn/edge-admin-linux-amd64-plus-v1.4.7.zip"
SAVE_PATH="/tmp/edge-admin.zip"
echo "正在从指定链接下载..."
wget -O "$SAVE_PATH" "$DOWNLOAD_URL"
# 4. 解压文件到安装目录
echo "正在解压..."
unzip -o "$SAVE_PATH" -d "$INSTALL_DIR"
# 5. 执行安装和启动
# GoEdge 解压后通常会在目录里有一个 edge-admin 文件夹
if [ -d "$INSTALL_DIR/edge-admin" ]; then
cd "$INSTALL_DIR/edge-admin"
echo "正在安装系统服务..."
./edge-admin install
echo "正在启动服务..."
./edge-admin start
echo "安装完成!"
else
echo "解压后未找到 edge-admin 目录,请检查压缩包内容。"
fi