aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ssh-keys-import.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'mod/ssh-keys-import.rsc')
-rw-r--r--mod/ssh-keys-import.rsc9
1 files changed, 4 insertions, 5 deletions
diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc
index 8cafa95..00f443a 100644
--- a/mod/ssh-keys-import.rsc
+++ b/mod/ssh-keys-import.rsc
@@ -88,12 +88,11 @@
$LogPrint warning $0 ("File '" . $FileName . "' does not exist.");
:return false;
}
- :local Keys ([ /file/get $FileName contents ] . "\n");
+ :local Keys [ :tolf [ /file/get $FileName contents ] ];
- :do {
+ :foreach Line in=[ :deserialize $Keys delimiter="\n" from=dsv options=dsv.plain ] do={
+ :set Line ($Line->0);
:local Continue false;
- :local Line [ :pick $Keys 0 [ :find $Keys "\n" ] ];
- :set Keys [ :pick $Keys ([ :find $Keys "\n" ] + 1) [ :len $Keys ] ];
:local KeyVal [ :toarray [ $CharacterReplace $Line " " "," ] ];
:if ($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa") do={
:do {
@@ -110,5 +109,5 @@
:if ($Continue = false && [ :len ($KeyVal->0) ] > 0) do={
$LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.");
}
- } while=([ :len $Keys ] > 0);
+ }
}