Re: SSH Message processing (General questions)
I am using the Execute method and it is in blocking mode. We're generating most code dynamically, but I tried my best to put together a sample of what we're doing below.
Connect method
---------------------
this.Session = new WeOnlyDo.Client.SSH();
this.Session.LicenseKey = xxx;
this.Session.Login = this.Login;
this.Session.Password = this.Password;
this.Session.Timeout = this.TimeOut;
this.Session.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
this.Session.Port = this.Port;
this.Session.Blocking = true;
this.Session.Prompt = this.Prompt;
this.Session.Connect(this.Host);
...
ShellSessionAction parentAction = this.Parent as ShellSessionAction;
if (parentAction == null)
throw new ApplicationException( ShellCommandAction parent is not ShellSessionAction. );
SSH session = parentAction.Session;
// Is Session connected
if (session.State != WeOnlyDo.Client.SSH.States.Connected)
throw new SystemException( Session is not connected. );
ExecuteCommand(session, usr/local/bin/pbrun su-billapp ,this.prompt);
ExecuteCommand(session, cd /opt/apps/billing/${BillingEnv}/billing-batch/scripts/ ,this.prompt);
ExecuteCommand(session, . ./export_env_variables.sh
,this.prompt); //this line has the problem
ExecuteCommand(session, ksh ./delete_emp.sh 123456789
,this.prompt); //this line has the problem
...
Execute method (non important code left out)
-----------------------------
public string ExecuteCommand(WeOnlyDo.Client.SSH session, string commandText, string prompt)
{
string ret = string.Empty;
ret = session.Execute(commandText, this.Prompt, this.Timeout);
return ret
}
Thanks!
Complete thread:
- SSH Message processing - Gary Jones, 2008-02-18, 22:27
- Re: SSH Message processing - wodDamir, 2008-02-18, 22:30
- Re: SSH Message processing - garyjones, 2008-02-18, 22:43
- Re: SSH Message processing - wodDamir, 2008-02-18, 23:18
- Re: SSH Message processing - garyjones, 2008-02-19, 00:09
- Re: SSH Message processing - wodDamir, 2008-02-19, 09:09
- Re: SSH Message processing - garyjones, 2008-02-19, 16:45
- Re: SSH Message processing - woddrazen, 2008-02-19, 16:51
- Re: SSH Message processing - garyjones, 2008-02-19, 18:23
- Re: SSH Message processing - woddrazen, 2008-02-19, 16:51
- Re: SSH Message processing - garyjones, 2008-02-19, 16:45
- Re: SSH Message processing - wodDamir, 2008-02-19, 09:09
- Re: SSH Message processing - garyjones, 2008-02-19, 00:09
- Re: SSH Message processing - wodDamir, 2008-02-18, 23:18
- Re: SSH Message processing - garyjones, 2008-02-18, 22:43
- Re: SSH Message processing - wodDamir, 2008-02-18, 22:30