Use stored SSH port number for syncing

Resolves: #8
This commit is contained in:
Thomas Pike
2018-04-18 10:38:20 +02:00
parent a26e417833
commit 1437062829

View File

@@ -264,7 +264,7 @@ function sync_server($id, $only_username = null, $preview = false) {
$attempts = array('keys-sync', 'root');
foreach($attempts as $attempt) {
try {
$connection = ssh2_connect($hostname, 22);
$connection = ssh2_connect($hostname, $server->port);
} catch(ErrorException $e) {
echo date('c')." {$hostname}: Failed to connect.\n";
$server->sync_report('sync failure', 'SSH connection failed');