Skip to content

Commit

Permalink
Wait indefinitely for interface to come up.
Browse files Browse the repository at this point in the history
This will be useful combined with ovs-docker which needs an already running container to attach the interface to.
  • Loading branch information
morrolinux authored Feb 8, 2024
1 parent ab18014 commit c3782e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if [ $# -eq 1 -a -n "$1" ]; then
# skip wait-for-interface behavior if found in path
if ! which "$1" >/dev/null; then
# loop until interface is found, or we give up
NEXT_WAIT_TIME=1
until [ -e "/sys/class/net/$1" ] || [ $NEXT_WAIT_TIME -eq 4 ]; do
NEXT_WAIT_TIME=5
until [ -e "/sys/class/net/$1" ]; do
sleep $(( NEXT_WAIT_TIME++ ))
echo "Waiting for interface '$1' to become available... ${NEXT_WAIT_TIME}"
done
Expand Down

0 comments on commit c3782e9

Please sign in to comment.