Replies: 5 comments 10 replies
-
|
Hm... what happened with replies here... I got them on email... |
Beta Was this translation helpful? Give feedback.
-
|
@VShawn recommended: i suggest you can wait in the script file, e.g. in powershell: "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command myconnection.ovpn # open vpn
do {
Write-Host "waiting..."
sleep 3
} until(Test-NetConnection $Env:PRM_HOST -Port $Env:PRM_PORT | ? { $_.TcpTestSucceeded } ) # loop until IP:port is respondingI did not test the script, you may need debug above scrip to make it works :) |
Beta Was this translation helpful? Give feedback.
-
|
Great idea! I had to tweak your suggestion a little bit, but now it works. 😁😁😁 "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command myconnection.ovpn # open vpn tunnel
$loop = 0
do {
$loop++
Write-Host "Checking VPN connection... ($loop)"
} until (Test-Port $Env:PRM_HOST $Env:PRM_PORT | ? { $_.PortOpened } ) # loop until IP:port is respondingFunction Test-Port is from A fast way to check TCP port in Powershell I had to use Test-Port instead of Test-NetConnection, because
|
Beta Was this translation helpful? Give feedback.
-
|
I have a question. How do you solve the problem of VPN disconnection? For example, if you have two sessions that require a VPN connection and closing one will cause the VPN to disconnect, thereby causing the other connection to also be disconnected. |
Beta Was this translation helpful? Give feedback.
-
|
Fortunately I don't have to solve this problem. 😊 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
One of my windows servers is behind VPN. So I have to connect the VPN tunnel first, wait until it's connected, then run the RDP connection. I'm trying to automate this with PRemoteM 7.2.3 using OpenVPN 2.5.8.
Script before connect: "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command myconnection.ovpn
Script after disconnected: "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command disconnect myconnection.ovpn
Both scripts work. However they return immediately. So PRemoteM launches the RDP connection immediately. The result is that the RDP connection doesn't connect.
Any ideas how to fix this?
Markus
Beta Was this translation helpful? Give feedback.
All reactions