mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
mod/ssh-keys-import: $SSHKeysImport: add check for key type
This commit is contained in:
parent
ad6825571d
commit
53a80c81b1
|
@ -17,6 +17,7 @@
|
|||
:global GetRandom20CharAlNum;
|
||||
:global LogPrintExit2;
|
||||
:global MkDir;
|
||||
:global RequiredRouterOS;
|
||||
:global WaitForFile;
|
||||
|
||||
:if ([ :len $Key ] = 0 || [ :len $User ] = 0) do={
|
||||
|
@ -27,6 +28,11 @@
|
|||
$LogPrintExit2 warning $0 ("User '" . $User . "' does not exist.") true;
|
||||
}
|
||||
|
||||
:local Type [ :pick $Key 0 [ :find $Key " " ] ];
|
||||
:if (!(([ $RequiredRouterOS $0 "7.12beta1" ] = true && $Type = "ssh-ed25519") || $Type = "ssh-rsa")) do={
|
||||
$LogPrintExit2 warning $0 ("SSH key of type '" . $Type . "' is not supported.") true;
|
||||
}
|
||||
|
||||
:if ([ $MkDir "tmpfs/ssh-keys-import" ] = false) do={
|
||||
$LogPrintExit2 warning $0 ("Creating directory 'tmpfs/ssh-keys-import' failed!") true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue