summaryrefslogtreecommitdiffstats
path: root/ems/microservice-standalone/src/main/assembly/docker/instance_config.sh
blob: d856f576c3821a27bf05ad9ce1f5253d3823f17f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

MSB_IP=`echo $MSB_ADDR | cut -d: -f 1`
MSB_PORT=`echo $MSB_ADDR | cut -d: -f 2`
VES_IP=`echo $VES_ADDR | cut -d: -f 1`
VES_PORT=`echo $VES_ADDR | cut -d: -f 2`
USER_NAME=`echo $VES_AUTHINFO | cut -d: -f 1`
PASSWORD=`echo $VES_AUTHINFO | cut -d: -f 2`


sed -i "s|msbAddress.*|msbAddress: $MSB_IP:$MSB_PORT|" emsdriver/conf/emsdriver.yml
sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" emsdriver/conf/emsdriver.yml
if [ $SERVICE_IP ]; then
   sed -i "s|serviceIp.*|serviceIp: $SERVICE_IP|" emsdriver/conf/emsdriver.yml
fi
sed -i "s|msbAddress=.*|msbAddress=$MSB_IP:$MSB_PORT|" emsdriver/conf/config.properties
sed -i "s|event_api_url=.*|event_api_url=$VES_IP|" emsdriver/conf/config.properties
sed -i "s|port=.*|port=$VES_PORT|" emsdriver/conf/config.properties
sed -i "s|username=.*|username=$USER_NAME|" emsdriver/conf/config.properties
sed -i "s|password=.*|password=$PASSWORD|" emsdriver/conf/config.properties


cat emsdriver/conf/emsdriver.yml
cat emsdriver/conf/config.properties