bug fix: use different lscpd versions according to os detection

This commit is contained in:
Usman Nasir
2022-10-06 13:52:17 +05:00
parent e3755ba6f7
commit 75540f024d
2 changed files with 16 additions and 4 deletions

View File

@@ -1457,13 +1457,19 @@ autocreate_system_folders = On
lscpdPath = '/usr/local/lscp/bin/lscpd'
command = 'cp -f /usr/local/CyberCP/lscpd.0.4.0 /usr/local/lscp/bin/lscpd.0.4.0'
result = open('/etc/lsb-release', 'r').read()
lscpdSelection = 'lscpd-0.3.1'
if result.find('22.04') > -1:
lscpdSelection = 'lscpd.0.4.0'
command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = 'rm -f /usr/local/lscp/bin/lscpd'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = 'mv /usr/local/lscp/bin/lscpd.0.4.0 /usr/local/lscp/bin/lscpd'
command = f'mv /usr/local/lscp/bin/{lscpdSelection} /usr/local/lscp/bin/lscpd'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = 'chmod 755 %s' % (lscpdPath)

View File

@@ -1992,13 +1992,19 @@ autocreate_system_folders = On
if os.path.exists(lscpdPath):
os.remove(lscpdPath)
command = 'cp -f /usr/local/CyberCP/lscpd.0.4.0 /usr/local/lscp/bin/lscpd.0.4.0'
result = open(Upgrade.UbuntuPath, 'r').read()
lscpdSelection = 'lscpd-0.3.1'
if result.find('22.04') > -1:
lscpdSelection = 'lscpd.0.4.0'
command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}'
Upgrade.executioner(command, command, 0)
command = 'rm -f /usr/local/lscp/bin/lscpd'
Upgrade.executioner(command, command, 0)
command = 'mv /usr/local/lscp/bin/lscpd.0.4.0 /usr/local/lscp/bin/lscpd'
command = f'mv /usr/local/lscp/bin/{lscpdSelection} /usr/local/lscp/bin/lscpd'
Upgrade.executioner(command, command, 0)
command = f'chmod 755 {lscpdPath}'