View Single Post
  #11  
Old 01-31-2019, 08:30 AM
BjoernH BjoernH is offline
Registered User
 
Join Date: Mar 2018
Posts: 55
Quote:
Originally Posted by ekoranyi View Post
BjoernH,

It appears that you're trying to supply a range in your if statement. I haven't seen that syntax used before, can you point me to some documentation on its use?

Generally I see ranges with the syntax:
Code:
If strMyVal >= 5 And strMyVal <= 20 Then
In your case this would be a little more complex, you won't be able to use the full IP address. You may be able to use the Split function to split the IP and capture only the last octet. You could then compare against the value of the last octet.
Hi Eric, sorry for the delayed reply, I didn't have access to the lab due to upgrades.

I have been able to make it work using this:

Code:
'ssh to VMs
	For Each strHosts In Eval(vHost)
    If strHosts = "" Then Exit For

	If doWhat = "start" Then
		If (strHosts = "192.168.210.5") OR (strHosts = "192.168.210.20") Then
			crt.Sleep 300000
		End If
	End If
    crt.Screen.Send"ssh -q " & strHosts & vbCr
I'll email the entire script if you wish me to do so.


Rergards,
Bjoern
Reply With Quote