Update the v_bng init script to wait for tap0 81/22081/1
authorMatt Welch <matt.welch@intel.com>
Fri, 3 Nov 2017 20:00:15 +0000 (16:00 -0400)
committerMatt Welch <matt.welch@intel.com>
Fri, 3 Nov 2017 20:21:44 +0000 (16:21 -0400)
A route wasn't being added by the init script because vpp was not yet
ready.  This change will cause the init script to wait until the tap0
device has been created.

Change-Id: Ief11ce332e0ddfdf40b1fe8b9e067edf38568db0
Issue-ID: INT-63
Signed-off-by: Matt Welch <matt.welch@intel.com>
vnfs/vCPE/scripts/v_bng_init.sh

index e4a5983..ce20dc5 100644 (file)
@@ -2,5 +2,13 @@
 
 systemctl start vpp
 
-ip route add 10.3.0.0/24 via 192.168.40.41 dev tap0
+# wait for TAP_DEV to become active before setting a route
+TAP_DEV=tap0
+STATUS=$(ip link show $TAP_DEV 2> /dev/null)
+while [ -z "$STATUS" ]; do
+    echo "$(date) v_bng_init.sh: $TAP_DEV is not yet ready..."
+    sleep 1
+    STATUS=$(ip link show $TAP_DEV 2> /dev/null)
+done
+ip route add 10.3.0.0/24 via 192.168.40.41 dev $TAP_DEV