From 98d7eee454bde21932cea700fda3d74ab4fc1336 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 7 Nov 2023 13:48:49 +0100 Subject: mod/ssh-keys-import: continue import after intermediate failure --- mod/ssh-keys-import.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index dd80fe9..1513114 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -87,7 +87,11 @@ :set Keys [ :pick $Keys ([ :find $Keys "\n" ] + 1) [ :len $Keys ] ]; :local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ]; :if ($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa") do={ - $SSHKeysImport $Line $User; + :do { + $SSHKeysImport $Line $User; + } on-error={ + $LogPrintExit2 warning $0 ("Failed importing key for user '" . $User . "'.") false; + } :set Continue true; } :if ($Continue = false && $KeyVal->0 = "#") do={ -- cgit v1.2.3-70-g09d2