aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-28 21:05:50 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-28 21:40:00 +0200
commitfcd6e61849e9df92d3696eb5c5596a0625881d2c (patch)
tree3496ef82aa54eac76d8e6cafe096750bde2632ad
parent8b6f830fe89c9550ed877f50eb6ab59c8fa05911 (diff)
global-functions: $ScriptInstallUpdate: remove script on failure when installing
-rw-r--r--global-functions8
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;
+ }
}
}
}