jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
kurczews | 7b8621d | 2018-09-19 08:17:52 +0200 | [diff] [blame^] | 3 | FINAL_CONFIG_FILE=$1/conf/system.properties |
| 4 | TEMPLATE_CONFIG_FILE=$1/conf/system_template.properties |
jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 5 | |
| 6 | echo "Localizing the VID system configuration" |
| 7 | |
| 8 | mkdir -p "${VID_MYLOGIN_FEED_DIRECTORY}" |
| 9 | |
Amichai Hemli | b811269 | 2017-08-09 20:11:37 +0300 | [diff] [blame] | 10 | |
jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 11 | sed -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 Hemli | b811269 | 2017-08-09 20:11:37 +0300 | [diff] [blame] | 18 | -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' \ |
jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 21 | -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 Zieba | b4aa71e | 2018-09-10 08:35:18 +0200 | [diff] [blame] | 38 | -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} || { |
jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 40 | echo "ERROR: Could not process template file ${TEMPLATE_CONFIG_FILE} into ${FINAL_CONFIG_FILE}" |
| 41 | exit 4 |
| 42 | } |
| 43 | |
| 44 | echo "Localized ${FINAL_CONFIG_FILE} successfully." |