if not found, exit viwib2

This commit is contained in:
Nico Schottelius 2020-12-21 14:36:40 +01:00
parent 0a07a197bb
commit d2383c666c
1 changed files with 10 additions and 1 deletions

View File

@ -37,12 +37,21 @@ vpn_endpoint_host=vpn-2a0ae5c1600.ungleich.ch
vpn_endpoint_pubkey=ygZQW3OSiMJl/RpKyaJVE0GSt6bjEDnoxdMJsNiloRE=
i=0
found=""
while [ $i -lt 30 ]; do
echo "Trying to reach ${viwib_ip} ($i)"
ping -c1 ${viwib_ip} >/dev/null && break
if ping -c1 ${viwib_ip} >/dev/null; then
found="yes"
break
fi
i=$((i+1))
done
if [ -z "$found" ]; then
echo "Unable to contact viwib. Exiting"
exit 1
fi
cat <<EOF | ssh -t "root@${viwib_ip}"
set -x