Update version requirements and enhance upgrade script output: Changed minimum version requirement from 1.9.4 to 2.3.4 in upgrade scripts, improved recovery log messages, and added detailed success and warning messages for the upgrade process. Enhanced user interface elements in the HTML template for better readability.

This commit is contained in:
Master3395
2025-09-23 20:07:30 +02:00
parent 685a464ca5
commit cd38d6eb29
4 changed files with 129 additions and 32 deletions

View File

@@ -220,7 +220,7 @@ if [[ "$1" = *.*.* ]]; then
}
')
if [[ $Output = *">="* ]]; then
echo -e "\nYou must use version number higher than 1.9.4"
echo -e "\nYou must use version number higher than 2.3.4"
exit
else
Branch_Name="v${1//[[:space:]]/}"
@@ -614,7 +614,7 @@ done
# If essential directories are missing, perform recovery
if [ $CYBERCP_MISSING -eq 1 ]; then
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] RECOVERY: CyberCP installation appears damaged or incomplete. Initiating recovery..." | tee -a /var/log/cyberpanel_upgrade_debug.log
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] INFO: Some CyberCP directories are missing. Performing automatic recovery..." | tee -a /var/log/cyberpanel_upgrade_debug.log
# Backup any remaining configuration files if they exist
if [ -f "/usr/local/CyberCP/CyberCP/settings.py" ]; then
@@ -656,7 +656,7 @@ if [ $CYBERCP_MISSING -eq 1 ]; then
# Clean up temporary clone
rm -rf /usr/local/CyberCP_recovery_tmp
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Recovery completed. CyberCP structure restored." | tee -a /var/log/cyberpanel_upgrade_debug.log
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Recovery completed successfully. CyberCP structure restored." | tee -a /var/log/cyberpanel_upgrade_debug.log
else
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] ERROR: Failed to clone repository for recovery" | tee -a /var/log/cyberpanel_upgrade_debug.log
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Please run full installation instead of upgrade" | tee -a /var/log/cyberpanel_upgrade_debug.log
@@ -841,7 +841,7 @@ fi
}
Pre_Upgrade_Branch_Input() {
echo -e "\nPress the Enter key to continue with latest version, or enter specific version such as: \e[31m1.9.4\e[39m , \e[31m1.9.5\e[39m ...etc"
echo -e "\nPress the Enter key to continue with latest version, or enter specific version such as: \e[31m2.3.4\e[39m , \e[31m2.4.4\e[39m ...etc"
echo -e "\nIf nothing is input in 10 seconds, script will proceed with the latest stable version. "
echo -e "\nPlease press the Enter key or specify a version number, or wait for 10 seconds: "
printf "%s" ""
@@ -1412,20 +1412,84 @@ systemctl restart lscpd
}
Post_Install_Display_Final_Info() {
echo -e "\n"
echo "╔═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ █████████ █████ ███████████ ████ ║"
echo "║ ███▒▒▒▒▒███ ▒▒███ ▒▒███▒▒▒▒▒███ ▒▒███ ║"
echo "║ ███ ▒▒▒ █████ ████ ▒███████ ██████ ████████ ▒███ ▒███ ██████ ████████ ██████ ▒███ ║"
echo "║ ▒███ ▒▒███ ▒███ ▒███▒▒███ ███▒▒███▒▒███▒▒███ ▒██████████ ▒▒▒▒▒███ ▒▒███▒▒███ ███▒▒███ ▒███ ║"
echo "║ ▒███ ▒███ ▒███ ▒███ ▒███▒███████ ▒███ ▒▒▒ ▒███▒▒▒▒▒▒ ███████ ▒███ ▒███ ▒███████ ▒███ ║"
echo "║ ▒▒███ ███ ▒███ ▒███ ▒███ ▒███▒███▒▒▒ ▒███ ▒███ ███▒▒███ ▒███ ▒███ ▒███▒▒▒ ▒███ ║"
echo "║ ▒▒█████████ ▒▒███████ ████████ ▒▒██████ █████ █████ ▒▒████████ ████ █████▒▒██████ █████ ║"
echo "║ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒███ ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒ ║"
echo "║ ███ ▒███ ║"
echo "║ ▒▒██████ ║"
echo "║ ▒▒▒▒▒▒ ║"
echo "║ 🚀 UPGRADE COMPLETED SUCCESSFULLY! 🚀 ║"
echo "║ ║"
echo "╚═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╝"
Panel_Port=$(cat /usr/local/lscp/conf/bind.conf)
if [[ $Panel_Port = "" ]] ; then
Panel_Port="8090"
fi
if curl -I -XGET -k "https://127.0.0.1:${Panel_Port#*:}" | grep -q "200 OK" ; then
echo "###################################################################"
echo " CyberPanel Upgraded "
echo "###################################################################"
# Test if CyberPanel is accessible
echo -e "\n🔍 Testing CyberPanel accessibility..."
echo "╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ 🌐 ACCESS YOUR CYBERPANEL: ║"
echo "║ ║"
echo "║ • Local: https://127.0.0.1:${Panel_Port#*:}"
echo "║ • Remote: https://${SERVER_IP}:${Panel_Port#*:}"
echo "║ ║"
echo "║ 🔐 Default Login: admin / 1234567890 ║"
echo "║ ⚠️ Please change the default password immediately! ║"
echo "║ ║"
echo "╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════╝"
# Binary confirmation
echo -e "\n"
echo "╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ 🎯 UPGRADE STATUS: [████████████████████████████████████████████████████████] 100% ║"
echo "║ ║"
echo "║ ✅ All components installed successfully ║"
echo "║ ✅ Python dependencies resolved ║"
echo "║ ✅ WSGI-LSAPI compiled with optimizations ║"
echo "║ ✅ CyberPanel service is running ║"
echo "║ ✅ Web interface is accessible ║"
echo "║ ║"
echo "║ 🎉 UPGRADE COMPLETED SUCCESSFULLY! 🎉 ║"
echo "║ ║"
echo "╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════╝"
else
echo -e "\nSeems something wrong with upgrade, please check...\n"
echo -e "❌ CyberPanel may not be running properly. Please check the logs."
echo -e "\n"
echo "╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ ⚠️ UPGRADE COMPLETED WITH WARNINGS ║"
echo "║ ║"
echo "║ • CyberPanel files have been updated ║"
echo "║ • Some services may need manual restart ║"
echo "║ • Please check logs at /var/log/cyberpanel_upgrade_debug.log ║"
echo "║ ║"
echo "║ 🔧 Try running: systemctl restart lscpd ║"
echo "║ ║"
echo "╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════╝"
fi
echo -e "\n📋 Next Steps:"
echo -e " 1. Access your CyberPanel at the URL above"
echo -e " 2. Change the default admin password"
echo -e " 3. Configure your domains and websites"
echo -e " 4. Check system status in the dashboard"
echo -e "\n🧹 Cleaning up temporary files..."
rm -rf /root/cyberpanel_upgrade_tmp
echo -e "✅ Cleanup completed\n"
}
if [[ ! -d /etc/cyberpanel ]] ; then