aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/vCPE/scripts/v_bng_init.sh
diff options
context:
space:
mode:
authorMatt Welch <matt.welch@intel.com>2017-11-03 16:00:15 -0400
committerMatt Welch <matt.welch@intel.com>2017-11-03 16:21:44 -0400
commit46bcdf2efab68604d0a239fca0291f916e9a4349 (patch)
tree35bc1b4d411c147b8e7953114f24199e21eaecd1 /vnfs/vCPE/scripts/v_bng_init.sh
parent5dbdc39be5e927c07a486f2f40afd7597c0166cb (diff)
Update the v_bng init script to wait for tap0
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>
Diffstat (limited to 'vnfs/vCPE/scripts/v_bng_init.sh')
-rw-r--r--vnfs/vCPE/scripts/v_bng_init.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/vnfs/vCPE/scripts/v_bng_init.sh b/vnfs/vCPE/scripts/v_bng_init.sh
index e4a59835..ce20dc57 100644
--- a/vnfs/vCPE/scripts/v_bng_init.sh
+++ b/vnfs/vCPE/scripts/v_bng_init.sh
@@ -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
f='#n162'>162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212