Skip to content

Commit

Permalink
NetworkUpload. use ipAddress to start jSch session
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Jul 30, 2019
1 parent f072284 commit adabb08
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public SSHConfigFileSetup(SSHClientSetupChainRing nextChainRing) {
@Override
public Session setup(BoardPort port, JSch jSch) throws JSchException, IOException {
String ipAddress = port.getAddress();
String hostname = port.getBoardName().contains(".local") ? port.getBoardName() : port.getBoardName() + ".local";

File sshFolder = new File(System.getProperty("user.home"), ".ssh");
File sshConfig = new File(sshFolder, "config");
Expand All @@ -62,7 +61,7 @@ public Session setup(BoardPort port, JSch jSch) throws JSchException, IOExceptio

jSch.setConfigRepository(new OpenSSHConfigWrapper(configRepository, ipAddress));

return jSch.getSession(hostname);
return jSch.getSession(ipAddress);
}

public static class OpenSSHConfigWrapper implements ConfigRepository {
Expand Down

0 comments on commit adabb08

Please sign in to comment.