mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
mod/ssh-keys-import: continue import after intermediate failure
This commit is contained in:
@@ -87,7 +87,11 @@
|
||||
:set Keys [ :pick $Keys ([ :find $Keys "\n" ] + 1) [ :len $Keys ] ];
|
||||
:local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ];
|
||||
:if ($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa") do={
|
||||
$SSHKeysImport $Line $User;
|
||||
:do {
|
||||
$SSHKeysImport $Line $User;
|
||||
} on-error={
|
||||
$LogPrintExit2 warning $0 ("Failed importing key for user '" . $User . "'.") false;
|
||||
}
|
||||
:set Continue true;
|
||||
}
|
||||
:if ($Continue = false && $KeyVal->0 = "#") do={
|
||||
|
Reference in New Issue
Block a user