From 00baa2100e67182c82c7f59e5abb719cca7bb221 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Tue, 9 Jan 2018 08:15:04 +0100 Subject: BGP demo: exit init.sh if VPP failed to start Change-Id: I4fa97a404eb52da7ff73d527f5b28e0f5014b521 Signed-off-by: Marek Gradzki --- docker/bgp_demo/init/init.sh | 13 +++++++++++-- 1 file 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) -- cgit 1.2.3-korg