mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 09:16:11 +01:00
bug fix: email configurations reset
This commit is contained in:
@@ -1039,18 +1039,21 @@ class MailServerManagerUtils(multi.Thread):
|
|||||||
|
|
||||||
def centos_lib_dir_to_ubuntu(self, filename, old, new):
|
def centos_lib_dir_to_ubuntu(self, filename, old, new):
|
||||||
try:
|
try:
|
||||||
fd = open(filename, 'r')
|
command = "sed -i 's|%s|%s|g' %s" % (old, new, filename)
|
||||||
lines = fd.readlines()
|
ProcessUtilities.executioner(command, None, True)
|
||||||
fd.close()
|
|
||||||
fd = open(filename, 'w')
|
# fd = open(filename, 'r')
|
||||||
centos_prefix = old
|
# lines = fd.readlines()
|
||||||
ubuntu_prefix = new
|
# fd.close()
|
||||||
for line in lines:
|
# fd = open(filename, 'w')
|
||||||
index = line.find(centos_prefix)
|
# centos_prefix = old
|
||||||
if index != -1:
|
# ubuntu_prefix = new
|
||||||
line = line[:index] + ubuntu_prefix + line[index + len(centos_prefix):]
|
# for line in lines:
|
||||||
fd.write(line)
|
# index = line.find(centos_prefix)
|
||||||
fd.close()
|
# if index != -1:
|
||||||
|
# line = line[:index] + ubuntu_prefix + line[index + len(centos_prefix):]
|
||||||
|
# fd.write(line)
|
||||||
|
# fd.close()
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
'%s [centos_lib_dir_to_ubuntu][404]' % (str(msg)), 10)
|
'%s [centos_lib_dir_to_ubuntu][404]' % (str(msg)), 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user