diff options
author | Christian Hesse <mail@eworm.de> | 2022-06-28 21:05:50 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-06-28 21:40:00 +0200 |
commit | fcd6e61849e9df92d3696eb5c5596a0625881d2c (patch) | |
tree | 3496ef82aa54eac76d8e6cafe096750bde2632ad /global-functions | |
parent | 8b6f830fe89c9550ed877f50eb6ab59c8fa05911 (diff) |
global-functions: $ScriptInstallUpdate: remove script on failure when installing
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/global-functions b/global-functions index bf9538c..3a2497e 100644 --- a/global-functions +++ b/global-functions @@ -808,7 +808,13 @@ :set SourceNew ($Result->"data"); } } on-error={ - $LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "'!") false; + :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={ + $LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . \ + "', removing dummy. Typo on installation?") false; + /system/script/remove $Script; + } else={ + $LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "'!") false; + } } } } |