fix snappymail issues in upgrade

This commit is contained in:
Usman Nasir
2022-05-20 15:54:07 +05:00
parent c5adbcd40d
commit 26c9ffeed4
2 changed files with 18 additions and 1 deletions

View File

@@ -1315,6 +1315,9 @@ imap_folder_list_limit = 0
command = 'mv %s %s' % (includeFileOldPath, includeFileNewPath)
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = "sed -i 's|autocreate_system_folders = Off|autocreate_system_folders = On|g' %s" % (labsPath)
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
except BaseException as msg:
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [downoad_and_install_snappymail]")
return 0

View File

@@ -500,6 +500,20 @@ imap_folder_list_limit = 0
writeToFile.write(labsData)
writeToFile.close()
includeFileOldPath = '/usr/local/CyberCP/public/snappymail/_include.php'
includeFileNewPath = '/usr/local/CyberCP/public/snappymail/include.php'
if os.path.exists(includeFileOldPath):
writeToFile = open(includeFileOldPath, 'a')
writeToFile.write("\ndefine('APP_DATA_FOLDER_PATH', '/usr/local/lscp/cyberpanel/rainloop/data/');\n")
writeToFile.close()
command = 'mv %s %s' % (includeFileOldPath, includeFileNewPath)
Upgrade.executioner(command, 'mkdir snappymail configs', 0)
command = "sed -i 's|autocreate_system_folders = Off|autocreate_system_folders = On|g' %s" % (labsPath)
Upgrade.executioner(command, 'mkdir snappymail configs', 0)
os.chdir(cwd)
except BaseException as msg:
@@ -1977,7 +1991,7 @@ echo $oConfig->Save() ? 'Done' : 'Error';
command = "chown -R root:root /usr/local/lscp"
Upgrade.executioner(command, 'chown core code', 0)
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop/data"
command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop"
Upgrade.executioner(command, 'chown core code', 0)
command = "chmod 700 /usr/local/CyberCP/cli/cyberPanel.py"