mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $ScriptInstallUpdate: remove script on failure when installing
This commit is contained in:
parent
8b6f830fe8
commit
fcd6e61849
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue