From c86635ed56995345eb6e1d4adb62ea79a67a17ff Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 4 Nov 2020 10:57:44 +0100 Subject: [PATCH] [viirb] viirb3: stop if successful ping --- viirb-3-configure-vpnendpoint.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/viirb-3-configure-vpnendpoint.sh b/viirb-3-configure-vpnendpoint.sh index 77d64f4..8387449 100755 --- a/viirb-3-configure-vpnendpoint.sh +++ b/viirb-3-configure-vpnendpoint.sh @@ -58,6 +58,20 @@ cdist config -v -j8 ${vpn_endpoint_host} -c ${dot_cdist} # Might take longer due to reboot sleep 10 -ping -c10 ${my_wireguard_ip} -ping -c10 ${my_lan_ip} -ping -c90 ${my_wifi_ip} +i=0 +while [ $i -lt 10 ]; do + ping -c1 ${my_wireguard_ip} && break + i=$((i+1)) +done + +i=0 +while [ $i -lt 10 ]; do + ping -c1 ${my_lan_ip} && break + i=$((i+1)) +done + +i=0 +while [ $i -lt 10 ]; do + ping -c1 ${my_wifi_ip} && break + i=$((i+1)) +done