Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
18.1 Legacy Series
»
Cron to reset OpenVPN client
« previous
next »
Print
Pages: [
1
]
Author
Topic: Cron to reset OpenVPN client (Read 4728 times)
PimB
Newbie
Posts: 29
Karma: 1
Cron to reset OpenVPN client
«
on:
July 02, 2018, 08:10:30 pm »
I have multiple servers in my OpenVPN client config with 'random server' turned on. I'd like to reset the connections automatically (via cron?) so it switches between these servers. Can and if so, how can I do that?
Thanks for helping
Logged
franco
Administrator
Hero Member
Posts: 17656
Karma: 1611
Re: Cron to reset OpenVPN client
«
Reply #1 on:
July 03, 2018, 09:55:26 pm »
If you go to /usr/local/opnsense/service/conf/actions_service.conf and add the following line to [reload.all] :
description:Reload all services
It should bring up the service in the Cron GUI to be used.
This is lost on firmware updates. Maybe it does what you want, so we can use that as a base for discussion.
Cheers,
Franco
Logged
PimB
Newbie
Posts: 29
Karma: 1
Re: Cron to reset OpenVPN client
«
Reply #2 on:
July 03, 2018, 10:24:09 pm »
Thank you, that does the trick! It see it reloads all connections. Is it possible to narrow it down to just VPN?
«
Last Edit: July 03, 2018, 10:27:33 pm by PimB
»
Logged
franco
Administrator
Hero Member
Posts: 17656
Karma: 1611
Re: Cron to reset OpenVPN client
«
Reply #3 on:
July 04, 2018, 08:06:57 pm »
Yes, it's possible to narrow it down to VPN.
Create a new file e.g. /usr/local/opnsense/service/conf/actions.d/actions_custom.conf and add the following:
[vpn]
command:pluginctl vpn
parameters:
type:script_output
message:Reloading VPN subsystem
description:Reload VPN subsystem
You can test it using:
# configctl custom vpn
And it should output something like this:
Configuring IPsec VPN...done.
Syncing OpenVPN settings...done.
Cheers,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
18.1 Legacy Series
»
Cron to reset OpenVPN client