Simple stuff, made complicated!

This commit is contained in:
rperper
2018-11-07 09:20:05 -05:00
parent 2494b672d8
commit 1f509accd7
2 changed files with 15 additions and 13 deletions

View File

@@ -12,7 +12,6 @@ import random
import socket
from os.path import *
from stat import *
import installCyberPanel
# There can not be peace without first a great suffering.
@@ -47,6 +46,14 @@ class preFlightsChecks:
if do_exit:
sys.exit(code)
@staticmethod
def pureFTPDServiceName(self, distro):
if distro == ubuntu:
return 'pure-ftpd-mysql'
return 'pure-ftpd'
def checkIfSeLinuxDisabled(self):
try:
command = "sestatus"
@@ -3237,10 +3244,10 @@ milter_default_action = accept
if state == 'Off':
command = 'sudo systemctl stop ' + installCyberPanel.InstallCyberPanel.pureFTPDServiceName(distro)
command = 'sudo systemctl stop ' + preFlightsChecks.pureFTPDServiceName(distro)
subprocess.call(shlex.split(command))
command = 'sudo systemctl disable ' + installCyberPanel.InstallCyberPanel.pureFTPDServiceName(distro)
command = 'sudo systemctl disable ' + preFlightsChecks.pureFTPDServiceName(distro)
subprocess.call(shlex.split(command))
try:
@@ -3359,6 +3366,8 @@ def main():
checks.install_psutil()
checks.setup_gunicorn()
import installCyberPanel
installCyberPanel.Main(cwd, mysql, distro)
checks.fix_selinux_issue()
checks.install_psmisc()

View File

@@ -646,20 +646,13 @@ class InstallCyberPanel:
self.stdOut("MariaDB is now setup so it can support Cyberpanel's needs")
@staticmethod
def pureFTPDServiceName(self, distro):
if distro == ubuntu:
return 'pure-ftpd-mysql'
return 'pure-ftpd'
def installPureFTPD(self):
try:
count = 0
while (1):
if self.distro == ubuntu:
command = 'apt-get -y install ' + InstallCyberPanel.pureFTPDServiceName(self.distro)
command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro)
else:
command = "yum install -y pure-ftpd"
@@ -684,7 +677,7 @@ class InstallCyberPanel:
while(1):
command = "systemctl enable " + InstallCyberPanel.pureFTPDServiceName(self.distro)
command = "systemctl enable " + install.preFlightsChecks.pureFTPDServiceName(self.distro)
res = subprocess.call(shlex.split(command))
if res == 1:
@@ -785,7 +778,7 @@ class InstallCyberPanel:
cmd.append("systemctl")
cmd.append("start")
cmd.append(InstallCyberPanel.pureFTPDServiceName(self.distro))
cmd.append(install.preFlightsChecks.pureFTPDServiceName(self.distro))
res = subprocess.call(cmd)