On 31/05/17 17:05, Xen wrote: > Riccardo Paolo Bestetti schreef op 31-05-2017 16:01: >> It's not OpenVPN you should configure, but your Operating System. >> You should refer to its documentation or its relevant mailing list. > > You can also do: > > # crontab -l | { cat; echo "*/15 * * * * /bin/sh -c 'ifconfig | grep > tun0 > /dev/null || systemctl restart openvn'"; } | crontab > > This will check very 15 minutes whether tun0 is up and if not will use > systemctl to restart openvpn service. > > Not sure what runs on Raspbian.
As you use systemctl, that implies systemd. Then that hack is truly ugly compared to what systemd provides. Copy the openvpn unit file you want to use to /etc/systemd/system ... and add this line to that file in the [Service] section: Restart=on-failure To enable OpenVPN during boot: systemctl enable $UNIT_NAME -- kind regards, David Sommerseth
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users