Remote Script output

I’m really new to Xojo, I’ve decided on my first project to connects to a remote server with SSH and run a local script. Then output it to a textarea In the app. I’ve installed the MonkeyBreadSoftware SSH class and connected it to the remote server, to run the script. The problem is I only get the first line of the script output. I have a suspension the output is copied to the textarea before it finishes. Does anyone want to save this lost soul?

[code]var Session as SSH2SessionMBS = Window1.session

//* Request a shell */
var channel as SSH2ChannelMBS = session.OpenSession

if channel = nil then
output “Unable to open a session”
Return
end if

channel.SetBlocking false

app.YieldToNextThread
// read greetings
var s as string = channel.Read(10000)
'print s

// start new channel

//* Request a shell */
channel = session.OpenSession

if channel = nil then
output “Unable to open a session”
Return
end if

commandline = “/usr/sbin/iviershowproxys”
channel.Execute commandline

// wait until things are okay
while channel.LastError = -37
call channel.execute commandline
output "Lasterror: "+str(channel.LastError)

session.WaitSocket
wend

do
app.YieldToNextThread
s = channel.Read(10000)

if channel.LastError = session.kErrorEagain then
// no answer yet
Continue
else
s = ReplaceLineEndings(s, EndOfLine)
var lines() as string = split(s, EndOfLine)
Output “”
for each line as string in lines
output line
next
output “”
exit
end if
loop

channel.Close
channel = nil
[/code]

Hopefully you are not really new to programming in general. What you are trying to do can be difficult!

I recently created a class that uses the MBS SSH class as well as Curl to run commands on a remote server. Send me a private message with your email and I will send it to you.