mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
add command checking;
This commit is contained in:
@@ -291,7 +291,7 @@ services:
|
|||||||
### WriteConfig to compose-file
|
### WriteConfig to compose-file
|
||||||
|
|
||||||
command = f"mkdir -p /home/docker/{self.data['finalURL']}"
|
command = f"mkdir -p /home/docker/{self.data['finalURL']}"
|
||||||
result, message = ProcessUtilities.outputExecutioner(command)
|
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
|
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
|
||||||
@@ -304,7 +304,7 @@ services:
|
|||||||
WriteToFile.close()
|
WriteToFile.close()
|
||||||
|
|
||||||
command = f"mv {TempCompose} {self.data['ComposePath']}"
|
command = f"mv {TempCompose} {self.data['ComposePath']}"
|
||||||
result, message = ProcessUtilities.outputExecutioner(command)
|
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
|
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
|
||||||
@@ -316,7 +316,7 @@ services:
|
|||||||
####
|
####
|
||||||
|
|
||||||
command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d"
|
command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d"
|
||||||
result, message = ProcessUtilities.outputExecutioner(command)
|
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
|
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
|
||||||
@@ -345,7 +345,7 @@ services:
|
|||||||
### just restart ls for htaccess
|
### just restart ls for htaccess
|
||||||
|
|
||||||
from plogical.installUtilities import installUtilities
|
from plogical.installUtilities import installUtilities
|
||||||
installUtilities.reStartLiteSpeed()
|
installUtilities.reStartLiteSpeedSocket()
|
||||||
|
|
||||||
logging.statusWriter(self.JobID, 'Completed. [200]')
|
logging.statusWriter(self.JobID, 'Completed. [200]')
|
||||||
|
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ class ProcessUtilities(multi.Thread):
|
|||||||
try:
|
try:
|
||||||
if os.path.exists('/usr/local/CyberCP/debug'):
|
if os.path.exists('/usr/local/CyberCP/debug'):
|
||||||
logging.writeToFile(command)
|
logging.writeToFile(command)
|
||||||
|
|
||||||
if getpass.getuser() == 'root':
|
if getpass.getuser() == 'root':
|
||||||
if os.path.exists(ProcessUtilities.debugPath):
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
logging.writeToFile(command)
|
logging.writeToFile(command)
|
||||||
|
|||||||
Reference in New Issue
Block a user