Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-11-2007, 10:47 AM
deckard deckard is offline
Registered User
 
Join Date: Oct 2007
Posts: 3
Problem sending Ctrl-c break

I'm unable to get secure CRT 5.0.3 to accept a Ctrl-c break on a remote SSH Linux session.
The keymap editor tells me 'Ctrl+C' is \003 or Ctrl-VK_C but I can't get either of those to work.

crt.Screen.Send "\003"
crt.screen.SendSpecial "Ctrl-VK_C"

CRT won't even accept the last one, saying it's invalid.
I just can't figure it out, stumped.

A workaround would be acceptable too if anyone has a suggestion. I have a script that SSH's to many Linux boxes to reboot them. Works fine except that in the event one of the attempts hangs I need to cancel out and go on to the next one as otherwise the script can take forever to complete.
Reply With Quote
  #2  
Old 10-11-2007, 11:55 AM
jjh jjh is offline
VanDyke Customer Support
 
Join Date: Feb 2004
Posts: 819
Hello deckard.

Do you happen to have the "Use Windows copy and paste
hotkeys" setting enabled in the Emulation \ Mapped Keys
category of your Session Options?

Would you be able to provide a copy of your script?

If the script contains information that you wouldn't want to
post to a public forum, you can feel free to send it to us
at support@vandyke.com and reference this forum thread.

Thank you

JJH
Reply With Quote
  #3  
Old 10-11-2007, 12:28 PM
deckard deckard is offline
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks for the quick response JJH.
I guess it just took posting here to fix it as soon afterward I finally got it to go with:

crt.Screen.Send Chr(003)

On a related note, perhaps you can offer a suggestion to my other problem. When said SSH session hangs, I want to be able to detect it so I can setup a case statement, log the offending IP, etc. If an IP is hosed and the SSH session hangs, nothing happens except the cursor moves down to the next line and flashes, no text to key on whatsoever.

This is all I have at the moment, which of course doesn't work as I don't know what to make that last (xxx) string match the condition above where it's nothing more than a linefeed or CR then a flashing cursor.

Code:
result = crt.Screen.WaitForStrings ("(yes/no)?", "identity.4':", "xxx", 50)

MsgBox Now & ": result = " & result

If result = 1 Then
do some stuff and reboot the box
End If
	
If result = 2 Then
do some stuff and reboot the box
End If

If result = 3 Then
crt.Screen.Send Chr(003)
do more stuff
End If

Last edited by deckard; 10-11-2007 at 12:31 PM.
Reply With Quote
  #4  
Old 10-11-2007, 03:29 PM
deckard deckard is offline
Registered User
 
Join Date: Oct 2007
Posts: 3
I got it now thanks. Problem was I didn't fully understand how the timeout value worked with WaitForStrings. Everything working perfectly now.
Reply With Quote
  #5  
Old 10-12-2007, 09:53 AM
jjh jjh is offline
VanDyke Customer Support
 
Join Date: Feb 2004
Posts: 819
Hi deckard.

Thanks for letting me know. I'm glad you have it working.

JJH
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:42 PM.