Enhance OS detection and package management in installation scripts: Updated install.sh to improve OS detection logic for various CentOS, AlmaLinux, CloudLinux, Ubuntu, Debian, and openEuler versions. Refined package installation commands and added error handling for unsupported OS scenarios. Improved service name mapping in install.py for better compatibility across distributions.

This commit is contained in:
Master3395
2025-09-23 23:33:05 +02:00
parent cc9a6ad31b
commit 30cb78d0ef
3 changed files with 257 additions and 106 deletions

View File

@@ -81,8 +81,24 @@ class preFlightsChecks:
def get_service_name(self, service):
"""Get the correct service name for the current distribution"""
service_map = {
'pdns': 'pdns'
'pdns': 'pdns',
'powerdns': 'pdns',
'pure-ftpd': 'pure-ftpd',
'pureftpd': 'pure-ftpd'
}
# Platform-specific service name mapping
if self.is_debian_family():
if service in ['pdns', 'powerdns']:
return 'pdns-server'
elif service in ['pure-ftpd', 'pureftpd']:
return 'pure-ftpd'
elif self.is_centos_family():
if service in ['pdns', 'powerdns']:
return 'pdns'
elif service in ['pure-ftpd', 'pureftpd']:
return 'pure-ftpd'
return service_map.get(service, service)
def manage_service(self, service_name, action="start"):