Spotter-VM/frontlinesms/install.sh
Disassembler ce325cf3d0
Squashed commit of the following:
- Bump basic OS to Alpine 3.9
 - Restructure repo and add layer versioning
 - Use JSON for all metadata
 - Merge abuild branch (but without abuild)
2019-02-26 20:24:02 +01:00

21 lines
734 B
Bash
Executable File

#!/bin/sh
set -ev
cd $(realpath $(dirname "${0}"))/install
# Configure FrontlineSMS
mkdir -p /srv/frontlinesms/data
export FRONTLINESMS_ADMIN_USER="admin"
export FRONTLINESMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | base64)
export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base64)
envsubst <srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties
chown -R 8018:8018 /srv/frontlinesms/data
# Install service
cp etc/init.d/frontlinesms /etc/init.d/frontlinesms
rc-update -u
# Register application
vmmgr register-app frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"