BGP demo: exit init.sh if VPP failed to start 14/10014/1
authorMarek Gradzki <[email protected]>
Tue, 9 Jan 2018 07:15:04 +0000 (08:15 +0100)
committerMarek Gradzki <[email protected]>
Tue, 9 Jan 2018 10:12:02 +0000 (11:12 +0100)
Change-Id: I4fa97a404eb52da7ff73d527f5b28e0f5014b521
Signed-off-by: Marek Gradzki <[email protected]>
docker/bgp_demo/init/init.sh

index 14e60aa..8ed4cd2 100755 (executable)
@@ -10,9 +10,18 @@ NODE_NAME=vpp$1
 echo "Enable tuntap interface in startup.conf"
 echo -e "tuntap {\n  enable\n}\n" >> /etc/vpp/startup.conf
 
-/hc2vpp/vpp/start.sh
-echo "Waiting for vpp to start"
+/hc2vpp/vpp/start.sh & VPP_PID=$!
+echo "Waiting 5s for vpp to start"
 sleep 5
+VPP_VERSION=$(vppctl show version)
+if [ "${VPP_VERSION}" != "" ]
+then
+  echo "VPP started successfully. Version:"
+  echo "${VPP_VERSION}"
+else
+  echo "VPP failed to start. Stopping initialization script."
+  exit 1
+fi
 
 # Configure veth interfaces using VPP CLI
 # (not fully supported by hc2vpp 18.01)