From 0a07a197bb79ec3ae6caca7e55cc1ce17b1aaba0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Dec 2020 14:34:26 +0100 Subject: [PATCH] viwib2: wait up to 30 seconds trying to reach the viwib --- openwrt/viwib-2-configure.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openwrt/viwib-2-configure.sh b/openwrt/viwib-2-configure.sh index 1c582d2..ce2d83c 100755 --- a/openwrt/viwib-2-configure.sh +++ b/openwrt/viwib-2-configure.sh @@ -36,11 +36,12 @@ public_key=$(echo $private_key | wg pubkey) vpn_endpoint_host=vpn-2a0ae5c1600.ungleich.ch vpn_endpoint_pubkey=ygZQW3OSiMJl/RpKyaJVE0GSt6bjEDnoxdMJsNiloRE= -ping -c3 ${viwib_ip} -if [ $? -ne 0 ]; then - echo "Cannot reach ${viwib_ip}, aborting" - exit 1 -fi +i=0 +while [ $i -lt 30 ]; do + echo "Trying to reach ${viwib_ip} ($i)" + ping -c1 ${viwib_ip} >/dev/null && break + i=$((i+1)) +done cat <