Not getting correct exit status code (ExitStatus) - WeOnlyDo Discussion board

Not getting correct exit status code (ExitStatus) (wodSSH / wodSSH.NET)

by Jatin Mehta, Friday, March 10, 2006, 09:39 (6833 days ago)

Hi,

I'm using wodSSH in my ASP pages. My problem is ExitStatus property. It is not showing correct exit status. It always show me 0. If I check on server using echo $? then I get correct exit status codes.
I'm using Execute method to execute commands on server (unix).
Please let me know why is this happening? Am I doing something wrong in my ASP script?
Here is the snippet from function I made:

--------------------------------
Set oSSH = Server.CreateObject( WeOnlyDo.wodSSHCom.1 )
oSSH.Blocking = 1
oSSH.LicenseKey = WOD_LICENSE_KEY

'set access details
oSSH.Hostname = sHostName
oSSH.Login = sLogin
oSSH.PrivateKey = oSSHKey

'settings for connection
oSSH.Authentication = 2
oSSH.Protocol = 3
oSSH.Encryption = 7
oSSH.Compression = 6

'Make connection
oSSH.Connect

'shell info
oSSH.WaitFor sWaitFor
oSSH.Prompt = sPrompt

'execute command
sOutput = oSSH.Execute(sCommand & vbLf)
sOutput = sOutput & Exit code: & oSSH.ExitStatus

'disconnect the session
oSSH.Disconnect
--------------------------------

Do any settings on SSH server needs to be tweak for ExitStatus property to work?
Do I need to change anything in my code?
Also, is there any place where I can find example ASP codes?

Thanks in advance.

Regards,
Jatin


Complete thread: