summaryrefslogtreecommitdiffstats
path: root/docker/bgp_demo/init
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-01-09 08:15:04 +0100
committerMarek Gradzki <mgradzki@cisco.com>2018-01-09 11:12:02 +0100
commit00baa2100e67182c82c7f59e5abb719cca7bb221 (patch)
treede66b5393c6b43a8f306f156684182c5aea3f7a8 /docker/bgp_demo/init
parent686309091cf77d9b35cf5ae19c80172ad29d68b6 (diff)
BGP demo: exit init.sh if VPP failed to start
Change-Id: I4fa97a404eb52da7ff73d527f5b28e0f5014b521 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'docker/bgp_demo/init')
-rwxr-xr-xdocker/bgp_demo/init/init.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/docker/bgp_demo/init/init.sh b/docker/bgp_demo/init/init.sh
index 14e60aa0b..8ed4cd25c 100755
--- a/docker/bgp_demo/init/init.sh
+++ b/docker/bgp_demo/init/init.sh
@@ -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)