blob: be8a905af0b2e0ed9be473d1cf9631e9411bd1c4 [file] [log] [blame]
Pamela Dragoshd1728dc2017-02-14 19:57:17 -05001#! /bin/bash
2
3# config directory may contain an ip_addr.txt file that specifies
4# the VM IP address. Substitute this value in the URL in the
5# config.json file, overriding the hostname that came from the
6# REST_PAPURL_WITH_AUTH_PASSWORD property in console.conf. This is
7# to avoid hardcoding an IP address in console.conf that can change
8# from one VM instance to the next.
9
10if [[ -f config/ip_addr.txt ]]; then
11 vm_ip=$(<config/ip_addr.txt)
12 echo "Substituting VM IP address $vm_ip in console config.json file"
13 sed -i -e "s@http:.*:@http://$vm_ip:@" \
14 $POLICY_HOME/servers/console/webapps/ecomp/app/policyApp/Properties/config.json
15fi