#1
|
|||
|
|||
Exit Script without error popup
Hi,
My ultimate goal is to monitor the SSH session for a defined string and then create a dialog and send text when that string is found. This I can do, but it gives an error whenever the SSH connection is lost. I want to suppress popup error and just exit the script. I am starting the scrip using the Logon script option under Connection->Logon Actions. The relevant part of the script looks like this: Code:
crt.Screen.Synchronous = True Sub Main 'handle the login details here crt.Screen.Synchronous = False Do while 1 If crt.Screen.WaitForString ("Explict Text") = True Then Result = crt.Dialog.Prompt("Enter a value", "Enter Value") If Result = "" Then exit sub 'send the results here End If Loop End Sub Are you aware of another way to implement this functionality or to suppress the Connection Lost Error? Currently running 8.2.0. Thanks, Wes |
#2
|
|||
|
|||
As usual, as soon as I post a question, I get it to work. Here is the relevant change. I added both the Error Resume Next and the two Session.Connected checks.
Code:
Do while 1 On Error resume next If crt.Session.Connected = 0 then exit sub End If If text.WaitForString ("Explict Text") = True Then If crt.Session.Connected then Result = crt.Dialog.Prompt("Enter a value", "Enter Value") If Result = "" Then exit sub 'send the results here else Exit Sub End if End If Loop End Sub |
#3
|
|||
|
|||
Hi WesR,
Thanks for posting the solution. I am glad you were able to resolve the issue. ![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|