viwib2: wait up to 30 seconds trying to reach the viwib
This commit is contained in:
parent
517ca06b53
commit
0a07a197bb
1 changed files with 6 additions and 5 deletions
|
@ -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 <<EOF | ssh -t "root@${viwib_ip}"
|
||||
|
|
Loading…
Reference in a new issue