mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-08 13:13:13 +02:00
centralized execution ph1
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
php composer-setup.php
|
||||
php -r "unlink('composer-setup.php');"
|
||||
cp composer.phar /usr/bin/composer
|
||||
mv composer.phar /usr/bin/composer
|
||||
@@ -8,7 +8,7 @@ class FirewallUtilities:
|
||||
import install as inst
|
||||
try:
|
||||
cmd = shlex.split(command)
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
if inst.preFlightsChecks.resFailed(inst.get_distro(), res):
|
||||
inst.preFlightsChecks.stdOut("Failed to apply rule: " + command + " Error #" + str(res), 1)
|
||||
return 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -337,7 +337,7 @@ class InstallCyberPanel:
|
||||
|
||||
while (1):
|
||||
command = "systemctl start mysqld@1"
|
||||
res = subprocess.call(shlex.split(command))
|
||||
res = ProcessUtilities.executioner(shlex.split(command))
|
||||
|
||||
if install.preFlightsChecks.resFailed(self.distro, res):
|
||||
count = count + 1
|
||||
@@ -357,7 +357,7 @@ class InstallCyberPanel:
|
||||
|
||||
while (1):
|
||||
command = "systemctl enable mysqld@1"
|
||||
res = subprocess.call(shlex.split(command))
|
||||
res = ProcessUtilities.executioner(shlex.split(command))
|
||||
|
||||
if install.preFlightsChecks.resFailed(self.distro, res):
|
||||
count = count + 1
|
||||
@@ -546,7 +546,7 @@ class InstallCyberPanel:
|
||||
shutil.copy(ftpdPath + "/pureftpd-mysql.conf", '/etc/pure-ftpd/db/mysql.conf')
|
||||
|
||||
command = 'echo 1 > /etc/pure-ftpd/conf/TLS'
|
||||
subprocess.call(command, shell=True)
|
||||
ProcessUtilities.executioner(command, shell=True)
|
||||
|
||||
command = 'systemctl restart pure-ftpd-mysql.service'
|
||||
install.preFlightsChecks.call(command, self.distro, '[installPureFTPDConfigurations]',
|
||||
@@ -565,12 +565,12 @@ class InstallCyberPanel:
|
||||
|
||||
if self.distro == ubuntu:
|
||||
command = 'systemctl stop systemd-resolved'
|
||||
res = subprocess.call(shlex.split(command))
|
||||
res = ProcessUtilities.executioner(shlex.split(command))
|
||||
if res != 0:
|
||||
InstallCyberPanel.stdOut('Unable to stop systemd.resolved, prohits install of PowerDNS, error #' +
|
||||
str(res), 1, 1, os.EX_OSERR)
|
||||
command = 'systemctl disable systemd-resolved.service'
|
||||
res = subprocess.call(shlex.split(command))
|
||||
res = ProcessUtilities.executioner(shlex.split(command))
|
||||
if res != 0:
|
||||
InstallCyberPanel.stdOut(
|
||||
'Unable to disable systemd.resolved, prohits install of PowerDNS, error #' +
|
||||
|
||||
@@ -19,7 +19,7 @@ class mysqlUtilities:
|
||||
|
||||
command = 'mysql -u root -p' + password + ' -e "' + createDB + '"'
|
||||
cmd = shlex.split(command)
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
if res == 1:
|
||||
return 0
|
||||
@@ -29,7 +29,7 @@ class mysqlUtilities:
|
||||
command = 'mysql -u root -p' + password + ' -e "' + createUser + '"'
|
||||
|
||||
cmd = shlex.split(command)
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
if res == 1:
|
||||
return 0
|
||||
@@ -37,7 +37,7 @@ class mysqlUtilities:
|
||||
dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'localhost'"
|
||||
command = 'mysql -u root -p' + password + ' -e "' + dropDB + '"'
|
||||
cmd = shlex.split(command)
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
if res == 1:
|
||||
return 0
|
||||
|
||||
@@ -9,7 +9,7 @@ def installCertBot():
|
||||
cmd.append("install")
|
||||
cmd.append("certbot")
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
|
||||
installCertBot()
|
||||
@@ -44,7 +44,7 @@ class unInstallCyberPanel:
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
shutil.rmtree("/etc/postfix")
|
||||
shutil.rmtree("etc/dovecot")
|
||||
@@ -66,7 +66,7 @@ class unInstallCyberPanel:
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
shutil.rmtree("/var/lib/mysql")
|
||||
os.remove("/etc/my.cnf")
|
||||
@@ -88,7 +88,7 @@ class unInstallCyberPanel:
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
shutil.rmtree("/usr/local/lsws")
|
||||
|
||||
@@ -122,7 +122,7 @@ class unInstallCyberPanel:
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
shutil.rmtree("/etc/pure-ftpd")
|
||||
|
||||
@@ -141,7 +141,7 @@ class unInstallCyberPanel:
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
shutil.rmtree("/etc/pdns")
|
||||
|
||||
@@ -160,7 +160,7 @@ class unInstallCyberPanel:
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
res = ProcessUtilities.executioner(cmd)
|
||||
|
||||
shutil.rmtree("/etc/pdns")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user