diff options
author | Christian Hesse <mail@eworm.de> | 2023-09-15 09:54:03 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-09-15 09:54:59 +0200 |
commit | 557823c5c1c364d2d662069d4690640654fa1267 (patch) | |
tree | 9ae42f6030c345158a1b6aca0fb392a888a2ef1c | |
parent | 66ebcf2bbdb2a53328cb8603885da4d2da781b1c (diff) |
telegram-chat: create status files with /file/addrouteros-7.9beta4-9
We have no content, thus no issues with file size.
-rw-r--r-- | telegram-chat.rsc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/telegram-chat.rsc b/telegram-chat.rsc index a367b78..62a6ccc 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -106,12 +106,12 @@ $WaitFullyConnected; :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]); $MkDir "tmpfs/telegram-chat"; $LogPrintExit2 info $0 ("Running command from update " . $UpdateID . ": " . $Text) false; - :execute script=(":do {\n" . $Text . "\n} on-error={ :execute script=\"/\" file=" . $File . ".failed };" . \ - ":execute script=\"/\" file=" . $File . ".done") file=$File; - :if ([ $WaitForFile ($File . ".done.txt") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={ + :execute script=(":do {\n" . $Text . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \ + "/file/add name=\"" . $File . ".done\"") file=$File; + :if ([ $WaitForFile ($File . ".done") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={ :set State "The command did not finish, still running in background.\n\n"; } - :if ([ :len [ /file/find where name=($File . ".failed.txt") ] ] > 0) do={ + :if ([ :len [ /file/find where name=($File . ".failed") ] ] > 0) do={ :set State "The command failed with an error!\n\n"; } :local Content [ /file/get ($File . ".txt") contents ]; |