File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -96,17 +96,18 @@ $WaitFullyConnected;
9696 } else={
9797 :if ($TelegramChatActive = true && [ :len $Text ] > 0) do={
9898 :if ([ $ValidateSyntax $Text ] = true) do={
99+ :local State "";
99100 :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]);
100101 $MkDir "tmpfs/telegram-chat";
101102 $LogPrintExit2 info $0 ("Running command: " . $Text) false;
102103 :exec script=($Text . "; :execute script=\":put\" file=" . $File . ".done") file=$File;
103104 :if ([ $WaitForFile ($File . ".done.txt") 200 ] = false) do={
104- $LogPrintExit2 warning $0 ("Command did not finish, possibly still running.") false ;
105+ :set State "The command did not finish, still running in background.\n\n" ;
105106 }
106107 :local Content [ /file/get ($File . ".txt") content ];
107108 $SendTelegram2 ({ origin=$0; silent=false; \
108109 subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
109- message=("Command:\n" . $Text . "\n\nOutput :\n" . $Content) });
110+ message=("Command:\n" . $Text . "\n\n" . $State . "Output :\n" . $Content) });
110111 /file/remove "tmpfs/telegram-chat";
111112 } else={
112113 $LogPrintExit2 warning $0 ("The command failed syntax validation: " . $Text) false;
You can’t perform that action at this time.
0 commit comments