Add a ssh_options parameter to allow ssh checking

to consider non-default values (ie: a different port)

Patch by Jay Taylor
This commit is contained in:
Jaime Casanova
2013-12-19 00:58:10 -05:00
parent a1f4285e2b
commit 5e04ab6eae
4 changed files with 10 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ bool require_password = false;
/* Initialization of runtime options */
t_runtime_options runtime_options = { "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, "", "", 0 };
t_configuration_options options = { "", -1, "", MANUAL_FAILOVER, -1, "", "", "", "", "", "", -1 };
t_configuration_options options = { "", -1, "", MANUAL_FAILOVER, -1, "", "", "", "", "", "", "", -1 };
static char *server_mode = NULL;
static char *server_cmd = NULL;
@@ -1786,9 +1786,9 @@ test_ssh_connection(char *host, char *remote_user)
/* Check if we have ssh connectivity to host before trying to rsync */
if (!remote_user[0])
maxlen_snprintf(script, "ssh -o Batchmode=yes %s %s", host, TRUEBIN_PATH);
maxlen_snprintf(script, "ssh -o Batchmode=yes %s %s %s", options.ssh_options, host, TRUEBIN_PATH);
else
maxlen_snprintf(script, "ssh -o Batchmode=yes %s -l %s %s", host, remote_user, TRUEBIN_PATH);
maxlen_snprintf(script, "ssh -o Batchmode=yes %s %s -l %s %s", options.ssh_options, host, remote_user, TRUEBIN_PATH);
log_debug(_("command is: %s"), script);
r = system(script);