I am using Astrill VPN (via their applet) with private IP and for some reason my ISP seems to have different latencies to the same data center. It would not bother me much if the difference would be negligible, but I am getting as low as 117ms and as high as 220ms. Once the connection with VPN is established, it keeps the same latency for few days until my ISP change my WAN IP or I will reboot the router or there would be a random VPN disconnection.
So for me I would obviously prefer to keep the best latency, which is why I wonder if it is possible to setup a task which will check ping to Astrill's DNS server upon establishing VPN connection and if it is above let's say 130ms, it will reconnect VPN every 30-60 seconds?
I know how should the script look like for 6AM VPN restart:
cru a ovpnrestart '0 6 * * * killall -HUP openvpn'
echo "cru a ovpnrestart '0 6 * * * killall -HUP openvpn'" >> /jffs/scripts/init-start
But I wonder if it is possible to extend it for ping check upon startup and reconnect it based on the ping results?
So for me I would obviously prefer to keep the best latency, which is why I wonder if it is possible to setup a task which will check ping to Astrill's DNS server upon establishing VPN connection and if it is above let's say 130ms, it will reconnect VPN every 30-60 seconds?
I know how should the script look like for 6AM VPN restart:
cru a ovpnrestart '0 6 * * * killall -HUP openvpn'
echo "cru a ovpnrestart '0 6 * * * killall -HUP openvpn'" >> /jffs/scripts/init-start
But I wonder if it is possible to extend it for ping check upon startup and reconnect it based on the ping results?