blob: 7cd7be68dfcf913ba474c68e8dd5504f908d75e9 [file] [log] [blame]
jimmydot8b8addd2017-05-08 18:00:46 -04001#!/bin/bash
2
3FINAL_CONFIG_FILE=/tmp/vid/stage/WEB-INF/conf/system.properties
4TEMPLATE_CONFIG_FILE=/tmp/vid/stage/WEB-INF/conf/system_template.properties
5
6echo "Localizing the VID system configuration"
7
8mkdir -p "${VID_MYLOGIN_FEED_DIRECTORY}"
9
10sed -e 's/${VID_MYSQL_HOST}/'${VID_MYSQL_HOST}'/g' \
11 -e 's/${VID_MYSQL_PORT}/'${VID_MYSQL_PORT}'/g' \
12 -e 's/${VID_MYSQL_DBNAME}/'${VID_MYSQL_DBNAME}'/g' \
13 -e 's/${VID_MYSQL_USER}/'${VID_MYSQL_USER}'/g' \
14 -e 's/${VID_MYSQL_PASS}/'${VID_MYSQL_PASS}'/g' \
15 -e 's/${VID_AAI_HOST}/'${VID_AAI_HOST}'/g' \
16 -e 's/${VID_AAI_PORT}/'${VID_AAI_PORT}'/g' \
17 -e 's,${AAI_TRUSTSTORE_FILENAME},'${AAI_TRUSTSTORE_FILENAME}',g' \
18 -e 's/${AAI_TRUSTSTORE_PASSWD_X}/'${AAI_TRUSTSTORE_PASSWD_X}'/g' \
19 -e 's,${AAI_KEYSTORE_FILENAME},'${AAI_KEYSTORE_FILENAME}',g' \
20 -e 's/${AAI_KEYSTORE_PASSWD_X}/'${AAI_KEYSTORE_PASSWD_X}'/g' \
21 -e 's/${VID_APP_DISPLAY_NAME}/'${VID_APP_DISPLAY_NAME}'/g' \
22 -e 's ${VID_ECOMP_SHARED_CONTEXT_REST_URL} '${VID_ECOMP_SHARED_CONTEXT_REST_URL}' g' \
23 -e 's ${VID_ECOMP_REDIRECT_URL} '${VID_ECOMP_REDIRECT_URL}' g' \
24 -e 's ${VID_ECOMP_REST_URL} '${VID_ECOMP_REST_URL}' g' \
25 -e 's ${VID_MSO_SERVER_URL} '${VID_MSO_SERVER_URL}' g' \
26 -e 's/${VID_MSO_USER}/'${VID_MSO_USER}'/g' \
27 -e 's/${VID_MSO_PASS}/'${VID_MSO_PASS}'/g' \
28 -e 's,${VID_MYLOGIN_FEED_DIRECTORY},'${VID_MYLOGIN_FEED_DIRECTORY}',g' \
29 -e 's,${MSO_DME2_CLIENT_TIMEOUT},'${MSO_DME2_CLIENT_TIMEOUT}',g' \
30 -e 's,${MSO_DME2_CLIENT_READ_TIMEOUT},'${MSO_DME2_CLIENT_READ_TIMEOUT}',g' \
31 -e 's,${MSO_DME2_SERVER_URL},'${MSO_DME2_SERVER_URL}',g' \
32 -e 's,${MSO_DME2_ENABLED},'${MSO_DME2_ENABLED}',g' \
33 -e 's,${MSO_POLLING_INTERVAL_MSECS},'${MSO_POLLING_INTERVAL_MSECS}',g' \
34 -e 's,${VID_TRUSTSTORE_FILE},'${VID_TRUSTSTORE_FILE}',g' \
35 -e 's/${VID_TRUSTSTORE_PASS}/'${VID_TRUSTSTORE_PASS}'/g' ${TEMPLATE_CONFIG_FILE} > ${FINAL_CONFIG_FILE} || {
36 echo "ERROR: Could not process template file ${TEMPLATE_CONFIG_FILE} into ${FINAL_CONFIG_FILE}"
37 exit 4
38 }
39
40echo "Localized ${FINAL_CONFIG_FILE} successfully."