File tree Expand file tree Collapse file tree 2 files changed +29
-25
lines changed
Expand file tree Collapse file tree 2 files changed +29
-25
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- if [ -z " $WAIT_FOR_VPN " ]; then
4- echo " WAIT_FOR_VPN is empty or not set. Proceeding immediately..."
5- else
3+ TIMEOUT_SECONDS=2
4+ SLEEP_SECONDS=2
65
7- if [[ " ${WAIT_FOR_VPN:- " false" } " == " true" ]]; then
8- echo " Waiting for VPN to be connected..."
6+ if [[ " ${WAIT_FOR_VPN:- false} " == " true" ]]; then
7+ echo " 🔒 Waiting for VPN to be connected..."
98 while ! grep -s -q " connected" /shared/vpnstatus; do
10- # Also account for gluetun-style http controller - undocumented feature from https://github.com/qdm12/gluetun/issues/2277#issuecomment-2115964521
11- if (timeout 2s curl -s http://localhost:8000/v1/vpn/status | grep -q running); then
12- break
13- fi
14- echo " VPN not connected"
15- sleep 2
9+ echo " VPN not connected yet..."
10+ sleep " $SLEEP_SECONDS "
1611 done
17- echo " VPN Connected, starting application..."
12+ echo " ✅ VPN Connected. Starting application..."
1813fi
1914
20- fi
15+ if [[ " ${WAIT_FOR_GLUETUN:- false} " == " true" ]]; then
16+ echo " 🌐 Waiting for Gluetun to be ready..."
17+ until timeout " ${TIMEOUT_SECONDS} s" bash -c ' curl -s http://localhost:8000/v1/vpn/status | grep -q running' ; do
18+ echo " Gluetun not ready yet..."
19+ sleep " $SLEEP_SECONDS "
20+ done
21+ echo " ✅ Gluetun is ready. Starting application..."
22+ fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- if [ -z " $WAIT_FOR_VPN " ]; then
4- echo " WAIT_FOR_VPN is empty or not set. Proceeding immediately..."
5- else
3+ TIMEOUT_SECONDS=2
4+ SLEEP_SECONDS=2
65
7- if [[ " ${WAIT_FOR_VPN:- " false" } " == " true" ]]; then
8- echo " Waiting for VPN to be connected..."
6+ if [[ " ${WAIT_FOR_VPN:- false} " == " true" ]]; then
7+ echo " 🔒 Waiting for VPN to be connected..."
98 while ! grep -s -q " connected" /shared/vpnstatus; do
10- # Also account for gluetun-style http controller - undocumented feature from https://github.com/qdm12/gluetun/issues/2277#issuecomment-2115964521
11- if (timeout 2s curl -s http://localhost:8000/v1/vpn/status | grep -q running); then
12- break
13- fi
14- echo " VPN not connected"
15- sleep 2
9+ echo " VPN not connected yet..."
10+ sleep " $SLEEP_SECONDS "
1611 done
17- echo " VPN Connected, starting application..."
12+ echo " ✅ VPN Connected. Starting application..."
1813fi
1914
15+ if [[ " ${WAIT_FOR_GLUETUN:- false} " == " true" ]]; then
16+ echo " 🌐 Waiting for Gluetun to be ready..."
17+ until timeout " ${TIMEOUT_SECONDS} s" bash -c ' curl -s http://localhost:8000/v1/vpn/status | grep -q running' ; do
18+ echo " Gluetun not ready yet..."
19+ sleep " $SLEEP_SECONDS "
20+ done
21+ echo " ✅ Gluetun is ready. Starting application..."
2022fi
You can’t perform that action at this time.
0 commit comments