Actually some real stuff

This commit is contained in:
rperper
2018-10-26 16:25:13 -04:00
parent c2b09182c2
commit cb379b9281
3 changed files with 61 additions and 35 deletions

View File

@@ -3148,7 +3148,7 @@ def main():
os.mkdir("/etc/cyberpanel")
except OSError as e:
if e.errno != errno.EEXIST:
self.stdOut("Error creating /etc/cyberpanel directory: " + str(e), 1, 1, os.EX_CANTCREAT)
preFlightsChecks.stdOut("Error creating /etc/cyberpanel directory: " + str(e), 1, 1, os.EX_CANTCREAT)
else:
pass

View File

@@ -3,7 +3,7 @@ import subprocess
import os
import pexpect
from mysqlUtilities import mysqlUtilities
from install import preflightsChecks
import install
import installLog as logging
import shlex
import randomPassword
@@ -467,12 +467,16 @@ class InstallCyberPanel:
while(1):
if self.distro == ubuntu:
command = "systemctl enable mariadb"
else:
command = "systemctl enable mysql"
res = subprocess.call(shlex.split(command))
if res == 1:
count = count + 1
InstallCyberPanel.stdOut("Trying to enable MariaDB instance to start and system restart, trying again, try number: " + str(count))
InstallCyberPanel.stdOut("Trying to enable MariaDB instance to start at system restart, "
"trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Failed to enable MariaDB instance to run at system restart, "
"you can do this later using systemctl enable mysql! [installMySQL]")
@@ -895,7 +899,7 @@ class InstallCyberPanel:
while(1):
if self.distro == ubuntu:
command = "apt-get -y install pdns-backend-mysql"
command = "apt-get -y install pdns-server pdns-backend-mysql"
else:
command = 'yum -y install pdns pdns-backend-mysql'
cmd = shlex.split(command)

View File

@@ -6,14 +6,19 @@ import argparse
import os
import shlex
import socket
from install import preFlightsChecks
import install
#distros
centos=0
ubuntu=1
distro = install.get_distro()
class unInstallCyberPanel:
def unInstallCyberPanelRepo(self):
if distro == centos:
try:
copyPath = "/etc/yum.repos.d/cyberpanel.repo"
os.remove(copyPath)
@@ -41,7 +46,10 @@ class unInstallCyberPanel:
def removePostfixDovecot(self):
try:
if distro == centos:
command = 'yum -y remove postfix'
else:
command = 'apt-get -y remove postfix'
cmd = shlex.split(command)
@@ -63,7 +71,10 @@ class unInstallCyberPanel:
def removeMysql(self):
try:
if distro == centos:
command = 'yum -y remove mariadb mariadb-server'
else:
command = 'apt-get -y remove mariadb-server'
cmd = shlex.split(command)
@@ -85,7 +96,10 @@ class unInstallCyberPanel:
def removeLiteSpeed(self):
try:
if distro == centos:
command = 'yum -y remove openlitespeed'
else:
command = 'apt-get -y remove openlitespeed'
cmd = shlex.split(command)
@@ -119,7 +133,10 @@ class unInstallCyberPanel:
def removePureFTPD(self):
try:
if distro == centos:
command = 'yum -y remove pure-ftpd'
else:
command = 'apt-get -y remove pure-ftpd'
cmd = shlex.split(command)
@@ -137,8 +154,10 @@ class unInstallCyberPanel:
def removePowerDNS(self):
try:
if distro == centos:
command = 'yum -y remove pdns'
else:
command = 'apt-get -y remove pdns-server'
cmd = shlex.split(command)
@@ -157,7 +176,10 @@ class unInstallCyberPanel:
def removePHP(self):
try:
if distro == centos:
command = 'yum -y remove lsphp*'
else:
command = 'apt-get -y remove lsphp*'
cmd = shlex.split(command)