mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 10:04:19 +02:00
mod/ssh-keys-import: create directory later
This commit is contained in:
parent
4006d07222
commit
f1ad808734
|
@ -38,11 +38,6 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ $MkDir "tmpfs/ssh-keys-import" ] = false) do={
|
||||
$LogPrint warning $0 ("Creating directory 'tmpfs/ssh-keys-import' failed!");
|
||||
:return false;
|
||||
}
|
||||
|
||||
: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={
|
||||
|
@ -51,6 +46,11 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ $MkDir "tmpfs/ssh-keys-import" ] = false) do={
|
||||
$LogPrint warning $0 ("Creating directory 'tmpfs/ssh-keys-import' failed!");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local FileName ("tmpfs/ssh-keys-import/key-" . [ $GetRandom20CharAlNum 6 ] . ".pub");
|
||||
/file/add name=$FileName contents=($Key . ", md5=" . $FingerPrintMD5);
|
||||
$WaitForFile $FileName;
|
||||
|
|
Loading…
Reference in a new issue