mod/ssh-keys-import: :do ... on-error=... -> :onerror ... do=...

This commit is contained in:
Christian Hesse 2025-05-08 10:05:12 +02:00
parent 9ae21c00bd
commit 9cd4ed08a4

View file

@ -55,13 +55,13 @@
/file/add name=$FileName contents=($Key . ", md5=" . $FingerPrintMD5);
$WaitForFile $FileName;
:do {
:onerror Err {
/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 . "'.");
$RmDir "tmpfs/ssh-keys-import";
} on-error={
$LogPrint warning $0 ("Failed importing key.");
} do={
$LogPrint warning $0 ("Failed importing key: " . $Err);
$RmDir "tmpfs/ssh-keys-import";
:return false;
}