From d7994498491c0530fcce8abcbb519ac1f8d3cf48 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 29 Aug 2025 22:24:13 +0500 Subject: [PATCH] ubuntu 24 support inside cyberpanel --- plogical/processUtilities.py | 9 ++++++++- plogical/upgrade.py | 13 ++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 93d51e968..2e9746922 100644 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -20,6 +20,7 @@ class ProcessUtilities(multi.Thread): ubuntu20 = 3 ubuntu22Check = 0 alma9check = 0 + ubuntu24Check = 0 # New flag for Ubuntu 24.04 specific handling server_address = '/usr/local/lscpd/admin/comm.sock' token = "unset" portPath = '/usr/local/lscp/conf/bind.conf' @@ -174,7 +175,13 @@ class ProcessUtilities(multi.Thread): with open('/etc/os-release', 'r') as f: content = f.read() if 'Ubuntu' in content: - if '22.04' in content: + if '24.04' in content: + ProcessUtilities.ubuntu22Check = 1 + ProcessUtilities.ubuntu24Check = 1 # Specific flag for Ubuntu 24.04 + # Ubuntu 24.04 uses newer package versions, set flag for compatibility + ProcessUtilities.alma9check = 1 # Reuse flag to indicate Ubuntu 24.04 + return ProcessUtilities.ubuntu20 + elif '22.04' in content: ProcessUtilities.ubuntu22Check = 1 return ProcessUtilities.ubuntu20 elif '20.04' in content: diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 99ed49444..a2d6805c0 100644 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -302,6 +302,7 @@ CloudLinux8 = 5 openEuler20 = 6 openEuler22 = 7 Ubuntu22 = 8 +Ubuntu24 = 9 class Upgrade: @@ -402,6 +403,8 @@ class Upgrade: return Ubuntu20 elif result.find('22.04') > -1: return Ubuntu22 + elif result.find('24.04') > -1: + return Ubuntu24 else: return Ubuntu18 @@ -1651,7 +1654,7 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL except: pass - if Upgrade.FindOperatingSytem() == Ubuntu22: + if Upgrade.FindOperatingSytem() == Ubuntu22 or Upgrade.FindOperatingSytem() == Ubuntu24: ### If ftp not installed then upgrade will fail so this command should not do exit command = "sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' /etc/pure-ftpd/db/mysql.conf" @@ -2804,7 +2807,7 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL lscpdSelection = 'lscpd-0.3.1' if os.path.exists(Upgrade.UbuntuPath): result = open(Upgrade.UbuntuPath, 'r').read() - if result.find('22.04') > -1: + if result.find('22.04') > -1 or result.find('24.04') > -1: lscpdSelection = 'lscpd.0.4.0' else: lscpdSelection = 'lscpd.aarch64' @@ -2814,7 +2817,7 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL lscpdSelection = 'lscpd-0.3.1' if os.path.exists(Upgrade.UbuntuPath): result = open(Upgrade.UbuntuPath, 'r').read() - if result.find('22.04') > -1: + if result.find('22.04') > -1 or result.find('24.04') > -1: lscpdSelection = 'lscpd.0.4.0' command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}' @@ -3318,7 +3321,7 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = 'systemctl restart postfix' Upgrade.executioner(command, 0) - elif Upgrade.FindOperatingSytem() == Ubuntu20 or Upgrade.FindOperatingSytem() == Ubuntu22: + elif Upgrade.FindOperatingSytem() == Ubuntu20 or Upgrade.FindOperatingSytem() == Ubuntu22 or Upgrade.FindOperatingSytem() == Ubuntu24: debPath = '/etc/apt/sources.list.d/dovecot.list' # writeToFile = open(debPath, 'w') @@ -4367,7 +4370,7 @@ extprocessor proxyApacheBackendSSL { ## - if Upgrade.FindOperatingSytem() == Ubuntu22 or Upgrade.FindOperatingSytem() == Ubuntu18 \ + if Upgrade.FindOperatingSytem() == Ubuntu22 or Upgrade.FindOperatingSytem() == Ubuntu24 or Upgrade.FindOperatingSytem() == Ubuntu18 \ or Upgrade.FindOperatingSytem() == Ubuntu20: print("Install Quota on Ubuntu")