Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Control VPN Connection
Control VPN Connection
I've been searching around to no avail. Here is the situation. At specific times I want my computer to use a vpn connection and at certain times my normal connection. I would like to use eventghost to turn my vpn connection on and off at specific times.... Anyone?
Re: Control VPN Connection
What kind of VPN? If you are using OpenVPN you can use command line to start and stop the client.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Control VPN Connection
I just tested the VPN connection/disconnection in Windows 7.
It works very reliably. I did it as follows:And here are the scripts:
Connection:Disconnection:Pako
It works very reliably. I did it as follows:And here are the scripts:
Connection:
Code: Select all
VPNname = "name of my VPN connection"
VPNusername = "my VPN username"
VPNpassword = "my VPN password"
from subprocess import Popen, SW_HIDE
args = ["rasdial"]
args.append('"%s"' % VPNname)
args.append(VPNusername)
args.append(VPNpassword)
Popen(args, creationflags=SW_HIDE, shell=True)Code: Select all
VPNname = "name of my VPN connection"
from subprocess import Popen, SW_HIDE
args = ["rasdial.exe"]
args.append('"%s"' % VPNname)
args.append("/disconnect")
Popen(args, creationflags=SW_HIDE, shell=True)