mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-01 16:54:38 +02:00
mod/ssh-keys-import: use $RmDir
This commit is contained in:
parent
6570a84904
commit
0fea300fea
1 changed files with 3 additions and 2 deletions
|
@ -19,6 +19,7 @@
|
|||
:global GetRandom20CharAlNum;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmDir;
|
||||
:global WaitForFile;
|
||||
|
||||
:if ([ :len $Key ] = 0 || [ :len $User ] = 0) do={
|
||||
|
@ -58,10 +59,10 @@
|
|||
/user/ssh-keys/import public-key-file=$FileName user=$User;
|
||||
$LogPrint info $0 ("Imported ssh public key (" . $KeyVal->2 . ", " . $KeyVal->0 . ", " . \
|
||||
"MD5:" . $FingerPrintMD5 . ") for user '" . $User . "'.");
|
||||
/file/remove "tmpfs/ssh-keys-import";
|
||||
$RmDir "tmpfs/ssh-keys-import";
|
||||
} on-error={
|
||||
$LogPrint warning $0 ("Failed importing key.");
|
||||
/file/remove "tmpfs/ssh-keys-import";
|
||||
$RmDir "tmpfs/ssh-keys-import";
|
||||
:return false;
|
||||
}
|
||||
} on-error={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue