mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-20 17:55:40 +02:00
mod/ssh-keys-import: $SSHKeysImport: split with :deserialize
This commit is contained in:
parent
0837391c38
commit
1f526b3561
1 changed files with 1 additions and 2 deletions
|
@ -16,7 +16,6 @@
|
|||
:local Key [ :tostr $1 ];
|
||||
:local User [ :tostr $2 ];
|
||||
|
||||
:global CharacterReplace;
|
||||
:global GetRandom20CharAlNum;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
|
@ -32,7 +31,7 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ];
|
||||
:local KeyVal ([ :deserialize $Key delimiter=" " from=dsv options=dsv.plain ]->0);
|
||||
:if (!($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa")) do={
|
||||
$LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.");
|
||||
:return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue