Spotter-VM/frontlinesms/setup.sh

19 lines
707 B
Bash
Raw Normal View History

2018-04-21 22:43:57 +02:00
#!/bin/sh
set -e
2018-04-21 22:43:57 +02:00
2018-10-25 22:22:36 +02:00
cd $(realpath $(dirname "${0}"))/setup
2018-04-21 22:43:57 +02:00
# 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)
2018-10-25 22:22:36 +02:00
envsubst <srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties
2018-04-21 22:43:57 +02:00
chown -R 8018:8018 /srv/frontlinesms/data
2018-09-04 21:42:26 +02:00
vmmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"
2018-09-13 19:57:14 +02:00
# Install service
2018-10-25 22:22:36 +02:00
cp etc/init.d/frontlinesms /etc/init.d/frontlinesms
2018-09-13 19:57:14 +02:00
rc-update -u