2018-04-21 22:43:57 +02:00
|
|
|
#!/bin/sh
|
2018-10-28 16:04:11 +01:00
|
|
|
set -ev
|
2018-04-21 22:43:57 +02:00
|
|
|
|
2020-03-17 10:53:26 +01:00
|
|
|
# Volumes
|
|
|
|
FLSMS_DATA="${VOLUMES_DIR}/frontlinesms/flsms_data"
|
|
|
|
|
2018-04-21 22:43:57 +02:00
|
|
|
# Configure FrontlineSMS
|
2020-03-17 10:53:26 +01:00
|
|
|
install -o 108080 -g 108080 -m 750 -d ${FLSMS_DATA}
|
2018-04-21 22:43:57 +02:00
|
|
|
export FRONTLINESMS_ADMIN_USER="admin"
|
2019-06-05 18:55:15 +02:00
|
|
|
export FRONTLINESMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
2018-04-21 22:43:57 +02:00
|
|
|
export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | base64)
|
|
|
|
export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base64)
|
2020-03-17 10:53:26 +01:00
|
|
|
envsubst <flsms_data/app-settings.properties | install -o 108080 -g 108080 -m 640 /dev/stdin ${FLSMS_DATA}/app-settings.properties
|
2018-10-28 19:50:35 +01:00
|
|
|
|
2018-11-03 15:53:51 +01:00
|
|
|
# Register application
|
2019-02-26 21:12:41 +01:00
|
|
|
vmmgr register-app frontlinesms sms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"
|