aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ssh-keys-import.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-12-09 09:13:18 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-12-09 11:49:50 +0100
commit519cb85e28e52c476ecb210e1ed201f64190f898 (patch)
tree0f64567c8631c4569c1ea62409f1f991b3039bc6 /mod/ssh-keys-import.rsc
parente51191035b21c529efb4387dfe59976c3112f561 (diff)
parent210ef26b93364f4b69cde9ff34139d51572357ee (diff)
Merge branch 'func-exit-error' into next
Diffstat (limited to 'mod/ssh-keys-import.rsc')
-rw-r--r--mod/ssh-keys-import.rsc12
1 files changed, 8 insertions, 4 deletions
diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc
index c7b2788..583e827 100644
--- a/mod/ssh-keys-import.rsc
+++ b/mod/ssh-keys-import.rsc
@@ -12,7 +12,7 @@
:global SSHKeysImportFile;
# import single key passed as string
-:set SSHKeysImport do={
+:set SSHKeysImport do={ :do {
:local Key [ :tostr $1 ];
:local User [ :tostr $2 ];
@@ -64,10 +64,12 @@
/file/remove "tmpfs/ssh-keys-import";
:return false;
}
-}
+} on-error={
+ :global ExitError; $ExitError false $0;
+} }
# import keys from a file
-:set SSHKeysImportFile do={
+:set SSHKeysImportFile do={ :do {
:local FileName [ :tostr $1 ];
:local User [ :tostr $2 ];
@@ -106,4 +108,6 @@
$LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.");
}
}
-}
+} on-error={
+ :global ExitError; $ExitError false $0;
+} }