diff --git a/debian-stretch-titan/ttcn3-docker-run.sh b/debian-stretch-titan/ttcn3-docker-run.sh index da3d3145..c8682204 100755 --- a/debian-stretch-titan/ttcn3-docker-run.sh +++ b/debian-stretch-titan/ttcn3-docker-run.sh @@ -14,7 +14,20 @@ SUBDIR=$1 SUITE=$2 if [ -n "$WAIT_FOR_NETDEV" ]; then + echo "Waiting for ${WAIT_FOR_NETDEV} to appear" pipework --wait -i "$WAIT_FOR_NETDEV" + + while true; do + if [ ! -f /sys/class/net/${WAIT_FOR_NETDEV}/operstate ]; then + exit 23 + fi + OPSTATE=$(cat /sys/class/net/${WAIT_FOR_NETDEV}/operstate) + if [ "$OPSTATE" = "up" ]; then + break + fi + echo "Waiting for ${WAIT_FOR_NETDEV} to become operational" + sleep 1 + done fi cd /data