Keep OpenVPN client alive

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
I am running a few TrueNAS core servers.
On my main one, I am running an OpenVPN server in an iocage jail.

The rest (4) of them are connected via the OpenVPN client under Services.
Every once in a while my OpenVPN server needs a restart (upgrading the NAS, changing the server config, etc).
After a restart, all clients normally reconnect.

However, the other day, after I ´d beed fiddling with my servers conf file, they did not. Not even after restoring it.

So, I would like to add a cron (or something) that checks if the OpenVPN client is connected, and if not, do something to connect again. Restart the service maybe?
Has anyone here done the same or something similar? What´s a good way to go about it?

And yeah, I get it. Don´t mess with it if it´s working. But sometimes I do anyway, and I´d like this kind of insurance that it will come back up again....
 
Top