mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-22 17:53:31 +02:00
mod/ssh-keys-import: use :onerror for outer block
This commit is contained in:
parent
5958851bd7
commit
af40ae82ed
1 changed files with 6 additions and 6 deletions
|
@ -12,7 +12,7 @@
|
||||||
:global SSHKeysImportFile;
|
:global SSHKeysImportFile;
|
||||||
|
|
||||||
# import single key passed as string
|
# import single key passed as string
|
||||||
:set SSHKeysImport do={ :do {
|
:set SSHKeysImport do={ :onerror Err {
|
||||||
:local Key [ :tostr $1 ];
|
:local Key [ :tostr $1 ];
|
||||||
:local User [ :tostr $2 ];
|
:local User [ :tostr $2 ];
|
||||||
|
|
||||||
|
@ -65,12 +65,12 @@
|
||||||
$RmDir "tmpfs/ssh-keys-import";
|
$RmDir "tmpfs/ssh-keys-import";
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
# import keys from a file
|
# import keys from a file
|
||||||
:set SSHKeysImportFile do={ :do {
|
:set SSHKeysImportFile do={ :onerror Err {
|
||||||
:local FileName [ :tostr $1 ];
|
:local FileName [ :tostr $1 ];
|
||||||
:local User [ :tostr $2 ];
|
:local User [ :tostr $2 ];
|
||||||
|
|
||||||
|
@ -109,6 +109,6 @@
|
||||||
$LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.");
|
$LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue