From ba088564087374ac71013f2e96e5ba1be93b3b74 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 14 Dec 2023 08:35:46 +0100 Subject: [PATCH] Update and rename 02-test_vpn.sh to 02-wpn.sh --- .../rootfs/etc/cont-init.d/02-test_vpn.sh | 14 -------------- qbittorrent/rootfs/etc/cont-init.d/02-wpn.sh | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) delete mode 100755 qbittorrent/rootfs/etc/cont-init.d/02-test_vpn.sh create mode 100755 qbittorrent/rootfs/etc/cont-init.d/02-wpn.sh diff --git a/qbittorrent/rootfs/etc/cont-init.d/02-test_vpn.sh b/qbittorrent/rootfs/etc/cont-init.d/02-test_vpn.sh deleted file mode 100755 index 03589d74c..000000000 --- a/qbittorrent/rootfs/etc/cont-init.d/02-test_vpn.sh +++ /dev/null @@ -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 diff --git a/qbittorrent/rootfs/etc/cont-init.d/02-wpn.sh b/qbittorrent/rootfs/etc/cont-init.d/02-wpn.sh new file mode 100755 index 000000000..2e73e02d6 --- /dev/null +++ b/qbittorrent/rootfs/etc/cont-init.d/02-wpn.sh @@ -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"