Confusion over VPN client setup

H Tom,

You can do away with your own script to check if openvpn is running. Systemd does it automatically with just one or two lines. If you’re interested, using sudo edit file /lib/systemd/system/openvpn@.service and in the [Service] section add:

Restart=always
RestartSec=5

The second line is optional. Then run:

sudo systemctl daemon-reload

and the new line(s) will take effect next time you start openvpn.

BTW, Restart=always doesn’t mean that you can’t stop openvpn yourself. It is also effective even if the openvpn service is disabled.