blob: 0947d49eaaa3360bc3e120dbb14890e87e998bce [file] [log] [blame]
jimmydot8b8addd2017-05-08 18:00:46 -04001#!/bin/bash
2
kurczews7b8621d2018-09-19 08:17:52 +02003FINAL_CONFIG_FILE=$1/conf/system.properties
4TEMPLATE_CONFIG_FILE=$1/conf/system_template.properties
jimmydot8b8addd2017-05-08 18:00:46 -04005
6echo "Localizing the VID system configuration"
7
8mkdir -p "${VID_MYLOGIN_FEED_DIRECTORY}"
9
Amichai Hemlib8112692017-08-09 20:11:37 +030010
jimmydot8b8addd2017-05-08 18:00:46 -040011sed -e 's/${VID_MYSQL_HOST}/'${VID_MYSQL_HOST}'/g' \
12 -e 's/${VID_MYSQL_PORT}/'${VID_MYSQL_PORT}'/g' \
13 -e 's/${VID_MYSQL_DBNAME}/'${VID_MYSQL_DBNAME}'/g' \
14 -e 's/${VID_MYSQL_USER}/'${VID_MYSQL_USER}'/g' \
15 -e 's/${VID_MYSQL_PASS}/'${VID_MYSQL_PASS}'/g' \
16 -e 's/${VID_AAI_HOST}/'${VID_AAI_HOST}'/g' \
17 -e 's/${VID_AAI_PORT}/'${VID_AAI_PORT}'/g' \
Amichai Hemlib8112692017-08-09 20:11:37 +030018 -e 's/${AAI_USE_CLIENT_CERT}/'${AAI_USE_CLIENT_CERT}'/g' \
19 -e 's/${AAI_VID_UID}/'${AAI_VID_UID}'/g' \
20 -e 's/${AAI_VID_PASSWD_X}/'${AAI_VID_PASSWD_X}'/g' \
jimmydot8b8addd2017-05-08 18:00:46 -040021 -e 's,${AAI_TRUSTSTORE_FILENAME},'${AAI_TRUSTSTORE_FILENAME}',g' \
22 -e 's/${AAI_TRUSTSTORE_PASSWD_X}/'${AAI_TRUSTSTORE_PASSWD_X}'/g' \
23 -e 's,${AAI_KEYSTORE_FILENAME},'${AAI_KEYSTORE_FILENAME}',g' \
24 -e 's/${AAI_KEYSTORE_PASSWD_X}/'${AAI_KEYSTORE_PASSWD_X}'/g' \
25 -e 's/${VID_APP_DISPLAY_NAME}/'${VID_APP_DISPLAY_NAME}'/g' \
26 -e 's ${VID_ECOMP_SHARED_CONTEXT_REST_URL} '${VID_ECOMP_SHARED_CONTEXT_REST_URL}' g' \
27 -e 's ${VID_ECOMP_REDIRECT_URL} '${VID_ECOMP_REDIRECT_URL}' g' \
28 -e 's ${VID_ECOMP_REST_URL} '${VID_ECOMP_REST_URL}' g' \
29 -e 's ${VID_MSO_SERVER_URL} '${VID_MSO_SERVER_URL}' g' \
30 -e 's/${VID_MSO_USER}/'${VID_MSO_USER}'/g' \
31 -e 's/${VID_MSO_PASS}/'${VID_MSO_PASS}'/g' \
32 -e 's,${VID_MYLOGIN_FEED_DIRECTORY},'${VID_MYLOGIN_FEED_DIRECTORY}',g' \
33 -e 's,${MSO_DME2_CLIENT_TIMEOUT},'${MSO_DME2_CLIENT_TIMEOUT}',g' \
34 -e 's,${MSO_DME2_CLIENT_READ_TIMEOUT},'${MSO_DME2_CLIENT_READ_TIMEOUT}',g' \
35 -e 's,${MSO_DME2_SERVER_URL},'${MSO_DME2_SERVER_URL}',g' \
36 -e 's,${MSO_DME2_ENABLED},'${MSO_DME2_ENABLED}',g' \
37 -e 's,${MSO_POLLING_INTERVAL_MSECS},'${MSO_POLLING_INTERVAL_MSECS}',g' \
Jakub Ziebab4aa71e2018-09-10 08:35:18 +020038 -e 's,${VID_TRUSTSTORE_FILE},'${VID_TRUSTSTORE_FILENAME}',g' \
39 -e 's/${VID_TRUSTSTORE_PASS}/'${VID_TRUSTSTORE_PASSWORD}'/g' ${TEMPLATE_CONFIG_FILE} > ${FINAL_CONFIG_FILE} || {
jimmydot8b8addd2017-05-08 18:00:46 -040040 echo "ERROR: Could not process template file ${TEMPLATE_CONFIG_FILE} into ${FINAL_CONFIG_FILE}"
41 exit 4
42 }
43
44echo "Localized ${FINAL_CONFIG_FILE} successfully."