no message
This commit is contained in:
@@ -466,6 +466,12 @@ public class UserConnection {
|
||||
shellChannel = null;
|
||||
System.gc();
|
||||
}
|
||||
public void waitForFileCreation(RemoteFile file) throws Exception {
|
||||
while (!Exists(file)){
|
||||
System.out.println(file.name +" NOT FOUND");
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
}
|
||||
//возможно в дальнейшем обобщить чтобы вместо PID был файл вывода с задаваемым именем?
|
||||
public String startShellProcess(RemoteFile directory, String outFileName, String... commands) throws Exception {
|
||||
Vector<String> commands_ = new Vector<>();
|
||||
@@ -486,10 +492,7 @@ public class UserConnection {
|
||||
RemoteFile outFile = new RemoteFile(directory, outFileName);
|
||||
ShellConnect();
|
||||
pin.write(("nohup " + start_command + " &\r\n").getBytes());
|
||||
while (!Exists(outFile)){
|
||||
System.out.println(outFileName +" NOT FOUND");
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
waitForFileCreation(outFile);
|
||||
ShellDisconnect();
|
||||
return readFromFile(outFile).replace("\n","").replace("\r","");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user