升级数据库
This commit is contained in:
@@ -41,9 +41,7 @@ VERSION=v0.1.0 curl -sSL https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/r
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 进入程序目录
|
# 进入程序目录
|
||||||
cd /opt/promdata-panel
|
curl -sSL https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/raw/branch/main/update.sh | bash
|
||||||
# 执行更新脚本
|
|
||||||
chmod +x update.sh && ./update.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. 系统初始化
|
#### 3. 系统初始化
|
||||||
|
|||||||
24
update.sh
24
update.sh
@@ -34,16 +34,30 @@ if [ -d ".git" ]; then
|
|||||||
else
|
else
|
||||||
echo -e "${BLUE}No git repository found. Updating via ZIP archive...${NC}"
|
echo -e "${BLUE}No git repository found. Updating via ZIP archive...${NC}"
|
||||||
|
|
||||||
# URL for zip download (adjust as needed for specific versioning)
|
# URL for zip download
|
||||||
ZIP_URL="https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/archive/main.tar.gz"
|
ZIP_URL="https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/archive/main.zip"
|
||||||
TEMP_DIR="/tmp/promdata_update_$(date +%s)"
|
TEMP_DIR="/tmp/promdata_update_$(date +%s)"
|
||||||
|
|
||||||
mkdir -p "$TEMP_DIR"
|
mkdir -p "$TEMP_DIR"
|
||||||
echo "Downloading latest version..."
|
echo "Downloading latest version (main branch)..."
|
||||||
curl -L "$ZIP_URL" -o "$TEMP_DIR/latest.tar.gz"
|
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..."
|
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
|
# The extracted folder is usually named project-main or similar
|
||||||
EXTRACTED_FOLDER=$(ls -d "$TEMP_DIR"/*/ | head -n 1)
|
EXTRACTED_FOLDER=$(ls -d "$TEMP_DIR"/*/ | head -n 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user