examples
Class RemoteShellScript
java.lang.Object
examples.RemoteShellScript
- All Implemented Interfaces:
- ExpectOutputStream.Expector
- public class RemoteShellScript
- extends java.lang.Object
- implements ExpectOutputStream.Expector
This is a simple demo of running a list of command-lines given as text
file. The commands are run sequentially and the stdout output from each
command is printed to the local stdout (stderr is also redirected to the
local stderr).
usage: RemoteShellScript <server[:port]> <username> <password> <script-file>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RemoteShellScript
public RemoteShellScript(SSH2ConsoleRemote console)
run
public java.lang.String run(java.lang.String cmd)
exit
public void exit()
reached
public void reached(ExpectOutputStream out,
byte[] buf,
int len)
- Specified by:
reached
in interface ExpectOutputStream.Expector
closed
public void closed(ExpectOutputStream out,
byte[] buf,
int len)
- Specified by:
closed
in interface ExpectOutputStream.Expector
main
public static void main(java.lang.String[] argv)
createSecureRandom
public static SecureRandomAndPad createSecureRandom()