mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-17 22:49:33 +00:00
mod/ssh-keys-import: drop old property
The property name changed in RouterOS 7.21beta2, so bump required version to 7.21.
This commit is contained in:
parent
1de4bdb909
commit
cf0607837c
1 changed files with 2 additions and 3 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright (c) 2020-2026 Christian Hesse <mail@eworm.de>
|
# Copyright (c) 2020-2026 Christian Hesse <mail@eworm.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.17
|
# requires RouterOS, version=7.21
|
||||||
#
|
#
|
||||||
# import ssh keys for public key authentication
|
# import ssh keys for public key authentication
|
||||||
# https://rsc.eworm.de/doc/mod/ssh-keys-import.md
|
# https://rsc.eworm.de/doc/mod/ssh-keys-import.md
|
||||||
|
|
@ -40,9 +40,8 @@
|
||||||
|
|
||||||
:local FingerPrintMD5 [ :convert from=base64 transform=md5 to=hex ($KeyVal->1) ];
|
:local FingerPrintMD5 [ :convert from=base64 transform=md5 to=hex ($KeyVal->1) ];
|
||||||
|
|
||||||
:local RegEx ("\\bmd5=" . $FingerPrintMD5 . "\\b");
|
|
||||||
:if ([ :len [ /user/ssh-keys/find where user=$User \
|
:if ([ :len [ /user/ssh-keys/find where user=$User \
|
||||||
(key-owner~$RegEx or info~$RegEx) ] ] > 0) do={
|
info~("\\bmd5=" . $FingerPrintMD5 . "\\b") ] ] > 0) do={
|
||||||
$LogPrint warning $0 ("The ssh public key (MD5:" . $FingerPrintMD5 . \
|
$LogPrint warning $0 ("The ssh public key (MD5:" . $FingerPrintMD5 . \
|
||||||
") is already available for user '" . $User . "'.");
|
") is already available for user '" . $User . "'.");
|
||||||
:return false;
|
:return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue