mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-02-16 19:46:48 +01:00
README: add v2.5.5-dev upgrade commands; preUpgrade pass -b; add --mariadb flag
- README: Upgrade to v2.5.5-dev section with non-interactive commands - preUpgrade.sh: pass -b branch to cyberpanel_upgrade.sh (fixes branch not used) - cyberpanel_upgrade.sh: add --mariadb for MariaDB 10.11 non-interactive
This commit is contained in:
24
README.md
24
README.md
@@ -112,6 +112,30 @@ sh <(curl -s https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preU
|
||||
|
||||
---
|
||||
|
||||
## Upgrade to v2.5.5-dev (non-interactive)
|
||||
|
||||
Upgrade to v2.5.5-dev without branch or MariaDB prompts:
|
||||
|
||||
```bash
|
||||
# Upgrade to v2.5.5-dev without prompts
|
||||
sh <(curl -s https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh) -b v2.5.5-dev
|
||||
|
||||
# With MariaDB 10.11 (non-interactive)
|
||||
sh <(curl -s https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh) -b v2.5.5-dev --mariadb
|
||||
|
||||
# Or use --mariadb-version for other versions
|
||||
sh <(curl -s https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh) -b v2.5.5-dev --mariadb-version 10.11
|
||||
sh <(curl -s https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh) -b v2.5.5-dev --mariadb-version 11.8
|
||||
```
|
||||
|
||||
**Full non-interactive command** (v2.5.5-dev + MariaDB 10.11):
|
||||
|
||||
```bash
|
||||
sh <(curl -s https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/master3395/cyberpanel/v2.5.5-dev/preUpgrade.sh) -b v2.5.5-dev --mariadb
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting (common)
|
||||
|
||||
**Command not found** — install curl/wget/git/python3
|
||||
|
||||
@@ -367,7 +367,11 @@ if [[ "$*" = *"--no-system-update"* ]]; then
|
||||
echo -e "\nUsing --no-system-update: skipping full system package update.\n"
|
||||
fi
|
||||
# Parse --mariadb-version 10.11|11.8|12.1 (default 11.8)
|
||||
if [[ "$*" = *"--mariadb-version "* ]]; then
|
||||
# --mariadb is shorthand for --mariadb-version 10.11 (MariaDB default, matches 10.11.x-MariaDB Server)
|
||||
if [[ "$*" = *"--mariadb"* ]] && [[ "$*" != *"--mariadb-version "* ]]; then
|
||||
MARIADB_VER="10.11"
|
||||
echo -e "\nUsing --mariadb: MariaDB 10.11 selected (non-interactive).\n"
|
||||
elif [[ "$*" = *"--mariadb-version "* ]]; then
|
||||
MARIADB_VER=$(echo "$*" | sed -n 's/.*--mariadb-version \([^ ]*\).*/\1/p' | head -1)
|
||||
MARIADB_VER="${MARIADB_VER:-11.8}"
|
||||
fi
|
||||
@@ -1768,8 +1772,8 @@ if [[ "$*" != *"--branch "* ]] && [[ "$*" != *"-b "* ]] ; then
|
||||
Pre_Upgrade_Branch_Input
|
||||
fi
|
||||
|
||||
# Prompt for MariaDB version if not set via --mariadb-version (default 11.8). Options: 10.11, 11.8, 12.1.
|
||||
if [[ "$*" != *"--mariadb-version "* ]]; then
|
||||
# Prompt for MariaDB version if not set via --mariadb or --mariadb-version (default 11.8). Options: 10.11, 11.8, 12.1.
|
||||
if [[ "$*" != *"--mariadb"* ]] && [[ "$*" != *"--mariadb-version "* ]]; then
|
||||
echo -e "\nMariaDB version: \e[31m10.11\e[39m, \e[31m11.8\e[39m LTS (default) or \e[31m12.1\e[39m. You can switch later by re-running with --mariadb-version 10.11, 11.8 or 12.1."
|
||||
echo -e "Press Enter for 11.8 LTS, or type \e[31m10.11\e[39m or \e[31m12.1\e[39m (5 sec timeout): "
|
||||
read -r -t 5 Tmp_MariaDB_Ver || true
|
||||
|
||||
@@ -2,10 +2,19 @@
|
||||
|
||||
# Check for branch parameter
|
||||
BRANCH_NAME=""
|
||||
if [ "$1" = "-b" ] || [ "$1" = "--branch" ]; then
|
||||
BRANCH_NAME="$2"
|
||||
shift 2
|
||||
fi
|
||||
EXTRA_ARGS=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-b|--branch)
|
||||
BRANCH_NAME="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
EXTRA_ARGS="$EXTRA_ARGS $1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# If no branch specified, get stable version
|
||||
if [ -z "$BRANCH_NAME" ]; then
|
||||
@@ -17,4 +26,5 @@ echo "Upgrading CyberPanel from branch: $BRANCH_NAME"
|
||||
rm -f /usr/local/cyberpanel_upgrade.sh
|
||||
wget -O /usr/local/cyberpanel_upgrade.sh https://raw.githubusercontent.com/master3395/cyberpanel/$BRANCH_NAME/cyberpanel_upgrade.sh 2>/dev/null
|
||||
chmod 700 /usr/local/cyberpanel_upgrade.sh
|
||||
/usr/local/cyberpanel_upgrade.sh $@
|
||||
# Pass -b so upgrade script skips branch prompt and uses our branch
|
||||
/usr/local/cyberpanel_upgrade.sh -b "$BRANCH_NAME" $EXTRA_ARGS
|
||||
|
||||
Reference in New Issue
Block a user