Update and rename 02-test_vpn.sh to 02-wpn.sh

This commit is contained in:
Alexandre
2023-12-14 08:35:46 +01:00
committed by GitHub
parent 2e7646af1b
commit ba08856408
2 changed files with 17 additions and 14 deletions

View File

@@ -1,14 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# wait until vpn is up
sleep 5
# test if vpn is up
counter=0
until [ "$counter" -gt 5 ]
do
ping -c 1 1.1.1.1 &> /dev/null && break || true
((counter++))
sleep 5
done

View File

@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# wait until vpn is up
sleep 5
# test if vpn is up
counter=0
until [ "$counter" -gt 10 ]
do
echo "... waiting until vpn is up"
ping -c 1 "1.1.1.1" &> /dev/null && exit 0 || true
((counter++))
sleep 5
done
bashio::log.fatal "vpn failed to get up for 60 seconds"