mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
upgrade: postfix3
This commit is contained in:
@@ -1276,6 +1276,11 @@ enabled=1"""
|
||||
|
||||
try:
|
||||
if self.distro == centos:
|
||||
|
||||
command = 'yum -y install http://cyberpanel.sh/gf-release-latest.gf.el7.noarch.rpm'
|
||||
subprocess.call(shlex.split(command))
|
||||
|
||||
|
||||
command = 'yum remove postfix -y'
|
||||
else:
|
||||
command = 'apt-get -y remove postfix'
|
||||
@@ -1286,7 +1291,7 @@ enabled=1"""
|
||||
count = 0
|
||||
while (1):
|
||||
if self.distro == centos:
|
||||
command = 'yum install -y postfix'
|
||||
command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
|
||||
else:
|
||||
command = 'apt-get -y debconf-utils'
|
||||
subprocess.call(shlex.split(command))
|
||||
|
||||
@@ -5,7 +5,6 @@ import os
|
||||
import socket
|
||||
import threading as multi
|
||||
import time
|
||||
from pipes import quote
|
||||
|
||||
class ProcessUtilities(multi.Thread):
|
||||
litespeedProcess = "litespeed"
|
||||
@@ -198,8 +197,6 @@ class ProcessUtilities(multi.Thread):
|
||||
command = command.replace('sudo', '')
|
||||
sock.sendall(command)
|
||||
|
||||
logging.writeToFile(command)
|
||||
|
||||
data = ""
|
||||
|
||||
while (1):
|
||||
|
||||
@@ -1595,6 +1595,71 @@ enabled=1"""
|
||||
|
||||
command = "systemctl restart dovecot"
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
|
||||
|
||||
### Postfix Upgrade
|
||||
|
||||
try:
|
||||
shutil.copy('/etc/postfix/master.cf', '/etc/master.cf')
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
shutil.copy('/etc/postfix/main.cf', '/etc/main.cf')
|
||||
except:
|
||||
pass
|
||||
|
||||
gf = '/etc/yum.repos.d/gf.repo'
|
||||
|
||||
gfContent = """[gf]
|
||||
name=Ghettoforge packages that won't overwrite core distro packages.
|
||||
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/$basearch/mirrorlist
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
|
||||
failovermethod=priority
|
||||
|
||||
[gf-plus]
|
||||
name=Ghettoforge packages that will overwrite core distro packages.
|
||||
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/$basearch/mirrorlist
|
||||
# Please read http://ghettoforge.org/index.php/Usage *before* enabling this repository!
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
|
||||
failovermethod=priority
|
||||
"""
|
||||
writeToFile = open(gf, 'w')
|
||||
writeToFile.write(gfContent)
|
||||
writeToFile.close()
|
||||
|
||||
command = 'yum remove postfix -y'
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
command = 'rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm'
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
command = 'yum clean all'
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
command = 'yum makecache fast'
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
command = 'yum install -y postfix3 postfix3-mysql'
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
try:
|
||||
shutil.move('/etc/master.cf', '/etc/postfix/master.cf')
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
shutil.move('/etc/main.cf', '/etc/postfix/main.cf')
|
||||
except:
|
||||
pass
|
||||
|
||||
command = 'systemctl restart postfix'
|
||||
Upgrade.executioner(command, 0)
|
||||
|
||||
else:
|
||||
command = 'curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import'
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
@@ -66,7 +66,6 @@ class SetupConn:
|
||||
except BaseException, msg:
|
||||
logging.writeToFile(str(msg) + ' [SetupConn.start_listening]')
|
||||
|
||||
|
||||
def __del__(self):
|
||||
self.sock.close()
|
||||
logging.writeToFile('Closing open connections!')
|
||||
|
||||
Reference in New Issue
Block a user