View Single Post
  #3  
Old 04-02-2008, 03:24 PM
darkoth darkoth is offline
Registered User
 
Join Date: Jun 2007
Posts: 29
Talking Changed

I changed the script to this FYI to whoever wants it.. seems to work good now.

Code:
#$language = "VBScript"
#$interface = "1.0"
' Send sudo login information to all tabs

crt.Screen.Synchronous = True

Sub Main()

	Dim result

	For nIndex = 1 to crt.GetTabCount
		Set objCurrentTab = crt.GetTab(nIndex)
		objCurrentTab.Activate
		if objCurrentTab.Session.Connected = True then
			crt.Sleep 500
			objCurrentTab.Screen.Send "/usr/local/bin/sudo -s" & chr(13)

			result = objCurrentTab.screen.WaitForString("Password:", 2)

			' result should be True or False 
			If result = True Then 
				objCurrentTab.Screen.Send "test123" & chr(13)
		        end if

			crt.Sleep 1000
		end if
	Next
End Sub
Reply With Quote