Update filemon.py

This commit is contained in:
SpudGunMan
2025-10-02 19:03:15 -07:00
parent 2e8206d4ec
commit a7de64b385
+7 -1
View File
@@ -95,7 +95,13 @@ def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
return "x: command not authorized in group chat"
if enable_runShellCmd:
command = message.removeprefix("x: ").strip()
if message.startswith("x: "):
command = message.removeprefix("x: ").strip()
elif message.startswith("x:"):
command = message.removeprefix("x:").strip()
else:
return "x: invalid command format"
try:
logger.info(f"FileMon: Running shell command from {message_from_id}: {command}")
output = os.popen(command).read().encode('utf-8').decode('utf-8')