aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-13 18:09:53 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-13 18:09:53 -0300
commit72827921d99f35686602ef8eb6ee56eaa6824b23 (patch)
tree8d59bfa8f66536b1df09b40caef0fd46bf99450a
parentb8b05773c2b51fdc67fdf57a3eec34923e2c67ea (diff)
downloadkvmx-72827921d99f35686602ef8eb6ee56eaa6824b23.tar.gz
kvmx-72827921d99f35686602ef8eb6ee56eaa6824b23.tar.bz2
Make argument optional at __kvmx_ssh_command
-rwxr-xr-xkvmx6
1 files changed, 5 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index 9575ef9..aaa3f95 100755
--- a/kvmx
+++ b/kvmx
@@ -59,8 +59,12 @@ function kvmx_app_base {
# Build a SSH command
function __kvmx_ssh_command {
+ if [ ! -z "$1" ]; then
+ local ssh_key_param="-i $1"
+ fi
+
# See http://blog.djm.net.au/2013/11/chacha20-and-poly1305-in-openssh.html
- SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o ProxyCommand=none -o Ciphers=chacha20-poly1305@openssh.com -o User=$SSH_LOGIN -i $1"
+ SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o ProxyCommand=none -o Ciphers=chacha20-poly1305@openssh.com -o User=$SSH_LOGIN $ssh_key_param"
SSH_COMMAND="ssh $SSH_OPTS"
SCP_COMMAND="scp $SSH_OPTS"
}