#$language = "VBScript"#$interface = "1.0"
crt.Screen.Synchronous = True
' This automatically generated script may need to be
' edited in order to work correctly.
Sub Main
noTimeout = 72000 '20h
nTimeout = 15 '15s
Dim nResult
Do
'MsgBox "Welcome to the 1st loop"
Do
'MsgBox "Welcome to the 2nd loop"
nResult = crt.Screen.WaitForString (" login: ", noTimeout)
If nResult = 0 Then '0:timeout 1:success
exit Do
End If
crt.Screen.Send "root" & chr(13)
nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",nTimeout)
If nResult = 0 Then
exit Do
End If
crt.Screen.Send "lsusb" & chr(13)
nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",nTimeout)
If nResult = 0 Then
exit Do
End If
crt.Screen.Send "lsusb -t" & chr(13)
nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",noTimeout)
If nResult = 0 Then
exit Do
End If
crt.Sleep 20000
crt.Screen.Send "lsusb" & chr(13)
nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",nTimeout)
If nResult = 0 Then
exit Do
End If
crt.Screen.Send "lsusb -t" & chr(13)
nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",noTimeout)
If nResult = 0 Then
exit Do
End If
crt.Screen.Send "ifconfig" & chr(13)
nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",nTimeout)
If nResult = 0 Then
exit Do
End If
' crt.Sleep 10000
' crt.Screen.Send "ifconfig" & chr(13)
' nResult = crt.Screen.WaitForString ("[cisco:"& chr(126)&"] $ ",nTimeout)' If nResult = 0 Then
'exit Do
' End If
' crt.Screen.Send "dmesg"& chr(13)' nResult = crt.Screen.WaitForString ("[cisco:" & chr(126) & "] $ ",nTimeout)
' If nResult = 0 Then
' exit Do
' End If
crt.Sleep 5000
crt.Screen.Send "reboot"& chr(13)
Loop While 1
Loop While 1
End Sub