problem: if there is a problem with the internet connection, the openvpn tunnel dies and is not beeing restarted automatically

solution:

>> ping openvpn server ip and restart vpn

root@GL-MT300N-V2:/tmp# crontab -l
######
# check vpn, cron need to be enabled! (/etc/init.d/cron enable + start)
######
1,16,31,46 * * * * ping -c 5 10.8.0.1 &> /dev/null && sleep 1 || /etc/init.d/openvpn restart
#23 * * * * echo "test2" >> /tmp/test

computer2know :: thank you for your visit :: have a nice day :: © 2022