mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-12-16 05:19:43 +01:00
Enhance branch detection and installation process in scripts: Updated cyberpanel.sh to improve branch/version detection logic based on execution context. Modified install.sh to allow installation from a specified branch and adjusted preUpgrade.sh to support branch parameter for upgrades. Improved error handling and logging for better user feedback.
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
BRANCH_NAME=v$(curl -s https://cyberpanel.net/version.txt | sed -e 's|{"version":"||g' -e 's|","build":|.|g'| sed 's:}*$::')
|
||||
# Check for branch parameter
|
||||
BRANCH_NAME=""
|
||||
if [ "$1" = "-b" ] || [ "$1" = "--branch" ]; then
|
||||
BRANCH_NAME="$2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
# If no branch specified, get stable version
|
||||
if [ -z "$BRANCH_NAME" ]; then
|
||||
BRANCH_NAME=v$(curl -s https://cyberpanel.net/version.txt | sed -e 's|{"version":"||g' -e 's|","build":|.|g'| sed 's:}*$::')
|
||||
fi
|
||||
|
||||
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/usmannasir/cyberpanel/$BRANCH_NAME/cyberpanel_upgrade.sh 2>/dev/null
|
||||
chmod 700 /usr/local/cyberpanel_upgrade.sh
|
||||
/usr/local/cyberpanel_upgrade.sh
|
||||
/usr/local/cyberpanel_upgrade.sh $@
|
||||
|
||||
Reference in New Issue
Block a user