From 50818b54caacde7bc83f6d1ac64e3a90200da8e0 Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Mon, 6 Apr 2026 16:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- update.sh | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e11ae84..384b6dd 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,7 @@ VERSION=v0.1.0 curl -sSL https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/r ```bash # 进入程序目录 -cd /opt/promdata-panel -# 执行更新脚本 -chmod +x update.sh && ./update.sh +curl -sSL https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/raw/branch/main/update.sh | bash ``` #### 3. 系统初始化 diff --git a/update.sh b/update.sh index fe7bae2..8b90cb9 100644 --- a/update.sh +++ b/update.sh @@ -34,16 +34,30 @@ if [ -d ".git" ]; then else echo -e "${BLUE}No git repository found. Updating via ZIP archive...${NC}" - # URL for zip download (adjust as needed for specific versioning) - ZIP_URL="https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/archive/main.tar.gz" + # URL for zip download + ZIP_URL="https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/archive/main.zip" TEMP_DIR="/tmp/promdata_update_$(date +%s)" mkdir -p "$TEMP_DIR" - echo "Downloading latest version..." - curl -L "$ZIP_URL" -o "$TEMP_DIR/latest.tar.gz" + echo "Downloading latest version (main branch)..." + curl -L "$ZIP_URL" -o "$TEMP_DIR/latest.zip" + # Ensure unzip is available + if ! command -v unzip &> /dev/null; then + echo -e "${BLUE}unzip is not installed. Attempting to install it...${NC}" + if command -v apt-get &> /dev/null; then + sudo apt-get update && sudo apt-get install -y unzip + elif command -v dnf &> /dev/null; then + sudo dnf install -y unzip + elif command -v yum &> /dev/null; then + sudo yum install -y yum-utils && sudo yum install -y unzip + elif command -v apk &> /dev/null; then + sudo apk add unzip + fi + fi + echo "Extracting archive..." - tar -xzf "$TEMP_DIR/latest.tar.gz" -C "$TEMP_DIR" + unzip -q "$TEMP_DIR/latest.zip" -d "$TEMP_DIR" # The extracted folder is usually named project-main or similar EXTRACTED_FOLDER=$(ls -d "$TEMP_DIR"/*/ | head -n 1)