mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-28 17:59:32 +02:00
resolve conflict between stable/p3
This commit is contained in:
@@ -88,9 +88,13 @@ class ProcessUtilities(multi.Thread):
|
||||
logging.writeToFile(str(msg) + "[stopLitespeed]")
|
||||
|
||||
@staticmethod
|
||||
def normalExecutioner(command):
|
||||
def normalExecutioner(command, shell=False):
|
||||
try:
|
||||
res = subprocess.call(shlex.split(command))
|
||||
if shell == False:
|
||||
res = subprocess.call(shlex.split(command))
|
||||
else:
|
||||
res = subprocess.call(command, shell=shell)
|
||||
|
||||
if res == 0:
|
||||
return 1
|
||||
else:
|
||||
@@ -207,10 +211,10 @@ class ProcessUtilities(multi.Thread):
|
||||
return "0" + str(msg)
|
||||
|
||||
@staticmethod
|
||||
def executioner(command, user=None):
|
||||
def executioner(command, user=None, shell=False):
|
||||
try:
|
||||
if getpass.getuser() == 'root':
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
ProcessUtilities.normalExecutioner(command, shell)
|
||||
return 1
|
||||
|
||||
ret = ProcessUtilities.sendCommand(command, user)
|
||||
@@ -231,7 +235,7 @@ class ProcessUtilities(multi.Thread):
|
||||
def outputExecutioner(command, user=None):
|
||||
try:
|
||||
if getpass.getuser() == 'root':
|
||||
return subprocess.check_output(shlex.split(command).decode("utf-8"))
|
||||
return subprocess.check_output(command, shell=True).decode("utf-8")
|
||||
|
||||
if type(command) == list:
|
||||
command = " ".join(command)
|
||||
|
||||
Reference in New Issue
Block a user