File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ $WaitFullyConnected;
100100 :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]);
101101 $MkDir "tmpfs/telegram-chat";
102102 $LogPrintExit2 info $0 ("Running command: " . $Text) false;
103- :exec script=(":do {\n" . $Text . "\n} on-error={};" . \
103+ :exec script=(":do {\n" . $Text . "\n} on-error={ :execute script=\":put\" file=" . $File . ".failed };" . \
104104 ":execute script=\":put\" file=" . $File . ".done") file=$File;
105105 :if ([ $WaitForFile ($File . ".done.txt") 200 ] = false) do={
106106 :set State "The command did not finish, still running in background.\n\n";
107107 }
108+ :if ([ :len [ /file/find where name=($File . ".failed.txt") ] ] > 0) do={
109+ :set State "The command failed with an error!\n\n";
110+ }
108111 :local Content [ /file/get ($File . ".txt") content ];
109112 $SendTelegram2 ({ origin=$0; silent=false; \
110113 subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
You can’t perform that action at this time.
0 commit comments