Skip to content
This repository was archived by the owner on Jan 5, 2025. It is now read-only.

Commit 6508963

Browse files
author
Flavio Fernandes
committed
entrypoint.sh: if interface was provided, wait for it to show up
1 parent d449b02 commit 6508963

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

util/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ set -e
33

44
# Single argument to command line is interface name
55
if [ -n "$1" ]; then
6+
# loop until interface is found, or we give up
7+
NEXT_WAIT_TIME=1
8+
until [ -e "/sys/class/net/$1" ] || [ $NEXT_WAIT_TIME -eq 4 ]; do
9+
sleep $(( NEXT_WAIT_TIME++ ))
10+
echo "Waiting for $1 to become available.... ${NEXT_WAIT_TIME}"
11+
done
612
if [ -e "/sys/class/net/$1" ]; then
713
IFACE=$1
814
fi

0 commit comments

Comments
 (0)