examples
Class RemoteShellScript

java.lang.Object
  extended byexamples.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>
 


Constructor Summary
RemoteShellScript(SSH2ConsoleRemote console)
           
 
Method Summary
 void closed(ExpectOutputStream out, byte[] buf, int len)
           
static SecureRandomAndPad createSecureRandom()
           
 void exit()
           
static void main(java.lang.String[] argv)
           
 void reached(ExpectOutputStream out, byte[] buf, int len)
           
 java.lang.String run(java.lang.String cmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteShellScript

public RemoteShellScript(SSH2ConsoleRemote console)
Method Detail

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()