Re: Clear wodSSH Buffers (General questions)
Hi Barry,
You should remove sleep api from your code. Also you should wait for a prompt and then send command. I don't see from your code that you are waiting for a prompt?
You can done that using WaitFor and Regular expression
$ #>]
means it will accept any of those chars ($, ,#,>) if they appear at the end of the line. This includes 99.9 of most UNIX command prompts (including root account).
You can then send command using execute Method. Here is example
[code]Set ssh1 = New wodSSHCom
ssh1.HostName = hostname
ssh1.Protocol = SSH2
ssh1.Blocking = True
ssh1.Login = login
ssh1.Password = password
ssh1.Connect
ssh1.WaitFor ( regex:[$ #>] $ )
ssh1.DataReady = 0
Debug.Print ssh1.Execute( Command to send + vbLf, regex:[$ #>] $ )
ssh1.Disconnect[/code]
Let us know how it goes.
Drazen
Complete thread:
- Clear wodSSH Buffers - bmclellan, 2008-04-18, 05:06
- Re: Clear wodSSH Buffers - woddrazen, 2008-04-18, 08:25
- Re: Clear wodSSH Buffers - bmclellan, 2008-04-18, 15:48
- Re: Clear wodSSH Buffers - woddrazen, 2008-04-18, 15:57
- Re: Clear wodSSH Buffers - bmclellan, 2008-04-18, 16:25
- Re: Clear wodSSH Buffers - wodDamir, 2008-04-18, 16:45
- Re: Clear wodSSH Buffers - bmclellan, 2008-04-29, 15:37
- Re: Clear wodSSH Buffers - wodDamir, 2008-04-18, 16:45
- Re: Clear wodSSH Buffers - bmclellan, 2008-04-18, 16:25
- Re: Clear wodSSH Buffers - woddrazen, 2008-04-18, 15:57
- Re: Clear wodSSH Buffers - bmclellan, 2008-04-18, 15:48
- Re: Clear wodSSH Buffers - woddrazen, 2008-04-18, 08:25