I am working on a JavaFX application and I cannot figure out how to write a ssh command on a launched terminal on iOS.
try {
Process process = Runtime.getRuntime().exec("/usr/bin/open -a /Applications/Utilities/Terminal.app /bin/bash");
int launched = process.waitFor();
BufferedWriter terminal = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
System.out.println(launched);
terminal.write("/usr/bin/ssh -o CheckHostIP=no -o TCPKeepAlive=yes -o StrictHostKeyChecking=no -o ServerAliveInterval=120 -o ServerAliveCountMax=100 -i ~/.aws/.ec2/dublin.pem ubuntu@"
+ selectedRow.get(publicDnsNameIndex).getValue() + "\n");
} catch (Exception e) {
e.printStackTrace();
}
launched
is always 0, so I can not write to the process anymore.
The full code is here https://github.com/gadelkareem/aws-client/blob/dev/src/main/java/com/gadelkareem/awsclient/application/Controller.java