Less picky detecting vpn down

This commit is contained in:
Greg Pringle 2021-05-15 08:42:00 -06:00
parent bf8b282876
commit fcedf0d6eb

View File

@ -90,8 +90,8 @@ if [ -e /proc/$qbpid ]; then
fi fi
fi fi
while true; do while true; do
sleep 60 #check once per minute if VPN is up sleep 120 #check once every couple minutes if VPN is up
ping -I tun0 -c 1 8.8.8.8 > /dev/null && VPNUP=true || VPNUP=false ping -I tun0 -c 10 8.8.8.8 > /dev/null && VPNUP=true || VPNUP=false
if [[ $VPNUP == false ]]; then if [[ $VPNUP == false ]]; then
echo "[crit] VPN down, shutting down docker (turn on auto restart to reconnect)" | ts '%Y-%m-%d %H:%M:%.S' echo "[crit] VPN down, shutting down docker (turn on auto restart to reconnect)" | ts '%Y-%m-%d %H:%M:%.S'
exit 5 exit 5