2019-10-02 19:46:00 +00:00
|
|
|
class ExecCommand:
|
|
|
|
def __init__(self, *args):
|
|
|
|
self.exec(*args)
|
|
|
|
|
2022-07-21 12:40:01 +00:00
|
|
|
def exec(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
2019-10-02 19:46:00 +00:00
|
|
|
if authed:
|
|
|
|
if length > 1:
|
2019-10-02 20:25:15 +00:00
|
|
|
try:
|
|
|
|
rtrn = exec(" ".join(spl[1:]))
|
|
|
|
except Exception as err:
|
|
|
|
failure(str(err))
|
|
|
|
return
|
|
|
|
info(str(rtrn))
|
2019-10-02 19:46:00 +00:00
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("exec")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|