From af2bc7be0c7d6b01c28e8d10ef609b6dd45ab365 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 30 Mar 2025 13:45:22 -0700 Subject: [PATCH] enhance sysinfo --- mesh_bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index a95b8d4..423f578 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -858,8 +858,12 @@ def sysinfo(message, message_from_id, deviceID): if enable_runShellCmd and file_monitor_enabled: # get the system information from the shell script # this is an example of how to run a shell script and return the data - shellData = call_external_script(None, "script/sysEnv.sh").rstrip() - return get_sysinfo(message_from_id, deviceID) + "\n" + shellData + shellData = call_external_script(None, "script/sysEnv.sh") + # check if the script returned data + if shellData == "" or shellData == None: + # no data returned from the script + shellData = "shell script data missing" + return get_sysinfo(message_from_id, deviceID) + "\n" + shellData.rstrip() else: return get_sysinfo(message_from_id, deviceID)