48f4ad3c18ac0de83a5191654e040e1faad21708
[vfc/nfvo/driver/sfc.git] / zte / sfc-driver / plugin-standalone / src / main / assembly / docker / docker-entrypoint.sh
1 #!/bin/bash
2
3 if [ -z "$SERVICE_IP" ]; then
4     export SERVICE_IP=`hostname -i`
5 fi
6 echo "SERVICE_IP=$SERVICE_IP"
7
8
9 if [ -z "$MSB_ADDR" ]; then
10     echo "Missing required variable MSB_ADDR: Microservices Service Bus address <ip>:<port>"
11     exit 1
12 fi
13 echo "MSB_ADDR=$MSB_ADDR"
14
15 # Wait for MSB initialization
16 echo "Wait for MSB initialization"
17 for i in {1..10}; do
18     curl -sS -m 1 $MSB_ADDR > /dev/null && break
19     sleep $i
20 done
21
22 # Configure service based on docker environment variables
23 docker/instance_config.sh
24
25 date > init.log
26
27 # Start the microservice
28 docker/instance_run.sh