Skip to content
Snippets Groups Projects
Commit 68ba5db2 authored by lucasbigeardel's avatar lucasbigeardel
Browse files

wip

parent 4bbcf3cb
No related branches found
No related tags found
1 merge request!2Dev/wizards
Pipeline #59429 passed
...@@ -22,60 +22,6 @@ public class AwsCondaClusterDeploymentApp implements IApplication { ...@@ -22,60 +22,6 @@ public class AwsCondaClusterDeploymentApp implements IApplication {
public final static String CONDA_CLUSTER_DEPLOYMENT_FILE = "aws.deployment.configuration"; public final static String CONDA_CLUSTER_DEPLOYMENT_FILE = "aws.deployment.configuration";
private void JschSession()
{
JSch jsch = new JSch();
try
{
Session session = jsch.getSession("root", "192.168.0.1", 22);
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
String command = "lsof -i :80";
Channel channel = session.openChannel("exec");
((ChannelExec) channel).setCommand(command);
channel.setInputStream(null);
((ChannelExec) channel).setErrStream(System.err);
InputStream in = channel.getInputStream();
channel.connect();
byte[] tmp = new byte[1024];
while (true)
{
while (in.available() > 0)
{
int i = in.read(tmp, 0, 1024);
if (i < 0)
break;
System.out.print(new String(tmp, 0, i));
}
if (channel.isClosed())
{
System.out.println("exit-status: " + channel.getExitStatus());
break;
}
try
{
Thread.sleep(1000);
}
catch (Exception ee)
{
}
}
channel.disconnect();
session.disconnect();
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment