mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 17:56:12 +01:00
Simple stuff, made complicated!
This commit is contained in:
@@ -12,7 +12,6 @@ import random
|
|||||||
import socket
|
import socket
|
||||||
from os.path import *
|
from os.path import *
|
||||||
from stat import *
|
from stat import *
|
||||||
import installCyberPanel
|
|
||||||
|
|
||||||
# There can not be peace without first a great suffering.
|
# There can not be peace without first a great suffering.
|
||||||
|
|
||||||
@@ -47,6 +46,14 @@ class preFlightsChecks:
|
|||||||
if do_exit:
|
if do_exit:
|
||||||
sys.exit(code)
|
sys.exit(code)
|
||||||
|
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def pureFTPDServiceName(self, distro):
|
||||||
|
if distro == ubuntu:
|
||||||
|
return 'pure-ftpd-mysql'
|
||||||
|
return 'pure-ftpd'
|
||||||
|
|
||||||
|
|
||||||
def checkIfSeLinuxDisabled(self):
|
def checkIfSeLinuxDisabled(self):
|
||||||
try:
|
try:
|
||||||
command = "sestatus"
|
command = "sestatus"
|
||||||
@@ -3237,10 +3244,10 @@ milter_default_action = accept
|
|||||||
|
|
||||||
if state == 'Off':
|
if state == 'Off':
|
||||||
|
|
||||||
command = 'sudo systemctl stop ' + installCyberPanel.InstallCyberPanel.pureFTPDServiceName(distro)
|
command = 'sudo systemctl stop ' + preFlightsChecks.pureFTPDServiceName(distro)
|
||||||
subprocess.call(shlex.split(command))
|
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))
|
subprocess.call(shlex.split(command))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -3359,6 +3366,8 @@ def main():
|
|||||||
checks.install_psutil()
|
checks.install_psutil()
|
||||||
checks.setup_gunicorn()
|
checks.setup_gunicorn()
|
||||||
|
|
||||||
|
import installCyberPanel
|
||||||
|
|
||||||
installCyberPanel.Main(cwd, mysql, distro)
|
installCyberPanel.Main(cwd, mysql, distro)
|
||||||
checks.fix_selinux_issue()
|
checks.fix_selinux_issue()
|
||||||
checks.install_psmisc()
|
checks.install_psmisc()
|
||||||
|
|||||||
@@ -646,20 +646,13 @@ class InstallCyberPanel:
|
|||||||
self.stdOut("MariaDB is now setup so it can support Cyberpanel's needs")
|
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):
|
def installPureFTPD(self):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
while (1):
|
while (1):
|
||||||
if self.distro == ubuntu:
|
if self.distro == ubuntu:
|
||||||
command = 'apt-get -y install ' + InstallCyberPanel.pureFTPDServiceName(self.distro)
|
command = 'apt-get -y install ' + install.preFlightsChecks.pureFTPDServiceName(self.distro)
|
||||||
else:
|
else:
|
||||||
command = "yum install -y pure-ftpd"
|
command = "yum install -y pure-ftpd"
|
||||||
|
|
||||||
@@ -684,7 +677,7 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
while(1):
|
while(1):
|
||||||
|
|
||||||
command = "systemctl enable " + InstallCyberPanel.pureFTPDServiceName(self.distro)
|
command = "systemctl enable " + install.preFlightsChecks.pureFTPDServiceName(self.distro)
|
||||||
res = subprocess.call(shlex.split(command))
|
res = subprocess.call(shlex.split(command))
|
||||||
|
|
||||||
if res == 1:
|
if res == 1:
|
||||||
@@ -785,7 +778,7 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
cmd.append("systemctl")
|
cmd.append("systemctl")
|
||||||
cmd.append("start")
|
cmd.append("start")
|
||||||
cmd.append(InstallCyberPanel.pureFTPDServiceName(self.distro))
|
cmd.append(install.preFlightsChecks.pureFTPDServiceName(self.distro))
|
||||||
|
|
||||||
res = subprocess.call(cmd)
|
res = subprocess.call(cmd)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user