Spotter-VM/lxc-apps/frontlinesms/install.sh
2019-10-03 20:19:13 +02:00

17 lines
675 B
Bash
Executable File

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