Auto restart VPN tunnel if down
-
Hello,
I need help creating a way for pfSense to test my client VPN tunnel and restart the connection if it is down. I have the following, which i found in these forums, in a shell file which will restart the tunnel but does not check the status.
echo "" | php -q
I would like a shell file that I can schedule within cron. Ideally it would run every 5 minutes and if the status of the VPN tunnel is up then it will do nothing, but if it is down it will restart. I need this because my current internet provider drops my connection quite often and the VPN does not automatically reestablish. But if I just run the code I have every 5 minutes it will disconnect my working connection and then reconnect.
Any help would be appreciated and details on what any script is doing is appreciated also but not required. I can google the details on lines of code if needed. Thanks in advance.