mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-23 18:29:30 +00:00
mod/ssh-keys-import: handle new parameter
With RouterOS 7.21beta2 the user SSH keys "key-owner" field was renamed to "info". Either of both is displayed in red by syntax highlighting, but it works anyway.
This commit is contained in:
parent
48d0f1f0b9
commit
5ffa85f8bf
2 changed files with 6 additions and 3 deletions
|
|
@ -40,7 +40,9 @@
|
|||
|
||||
:local FingerPrintMD5 [ :convert from=base64 transform=md5 to=hex ($KeyVal->1) ];
|
||||
|
||||
:if ([ :len [ /user/ssh-keys/find where user=$User key-owner~("\\bmd5=" . $FingerPrintMD5 . "\\b") ] ] > 0) do={
|
||||
:local RegEx ("\\bmd5=" . $FingerPrintMD5 . "\\b");
|
||||
:if ([ :len [ /user/ssh-keys/find where user=$User \
|
||||
(key-owner~$RegEx or info~$RegEx) ] ] > 0) do={
|
||||
$LogPrint warning $0 ("The ssh public key (MD5:" . $FingerPrintMD5 . \
|
||||
") is already available for user '" . $User . "'.");
|
||||
:return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue