telegram-chat: handle error in command...

This commit is contained in:
Christian Hesse 2023-02-01 10:55:28 +01:00
parent 44c30efbcd
commit c2cf05e9e5

View file

@ -100,7 +100,8 @@ $WaitFullyConnected;
:local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]);
$MkDir "tmpfs/telegram-chat";
$LogPrintExit2 info $0 ("Running command: " . $Text) false;
:exec script=($Text . "; :execute script=\":put\" file=" . $File . ".done") file=$File;
:exec script=(":do {\n" . $Text . "\n} on-error={};" . \
":execute script=\":put\" file=" . $File . ".done") file=$File;
:if ([ $WaitForFile ($File . ".done.txt") 200 ] = false) do={
:set State "The command did not finish, still running in background.\n\n";
}