Rework FrontlineSMS
This commit is contained in:
parent
ed0c6c90a7
commit
0bc2daf4ad
@ -4,17 +4,13 @@ set -ev
|
||||
cd $(realpath $(dirname "${0}"))/install
|
||||
|
||||
# Configure FrontlineSMS
|
||||
mkdir -p /srv/frontlinesms/data
|
||||
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 <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
|
||||
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}"
|
||||
|
@ -1,19 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="FrontlineSMS container"
|
||||
|
||||
start() {
|
||||
lxc-start frontlinesms
|
||||
}
|
||||
|
||||
start_post() {
|
||||
vmmgr register-proxy frontlinesms
|
||||
}
|
||||
|
||||
stop_pre() {
|
||||
vmmgr unregister-proxy frontlinesms
|
||||
}
|
||||
|
||||
stop() {
|
||||
lxc-stop frontlinesms
|
||||
}
|
@ -38,6 +38,4 @@ RUN EOF
|
||||
chown 8018:8018 frontlinesms-core_messages_cs*
|
||||
EOF
|
||||
|
||||
MOUNT DIR /srv/frontlinesms/data srv/frontlinesms/.frontlinesms2
|
||||
|
||||
CMD s6-svscan /etc/services.d
|
||||
|
18
lxc-apps/frontlinesms/meta
Normal file
18
lxc-apps/frontlinesms/meta
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": "0.0.1-190620",
|
||||
"meta": {
|
||||
"title": "FrontlineSMS",
|
||||
"desc-cs": "Hromadné odesílání zpráv",
|
||||
"desc-en": "Bulk SMS messaging",
|
||||
"license": "GPL",
|
||||
"proxy": "frontlinesms"
|
||||
},
|
||||
"containers": {
|
||||
"frontlinesms": {
|
||||
"image": "frontlinesms_0.0.1-190620",
|
||||
"mounts": [
|
||||
["DIR", "/srv/frontlinesms/flsms_data", "/srv/frontlinesms/.frontlinesms2"]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
# Remove service
|
||||
rm -f /etc/init.d/frontlinesms
|
||||
rc-update -u
|
||||
# Remove persistent data
|
||||
rm -rf /srv/frontlinesms
|
||||
|
||||
# Unregister application
|
||||
vmmgr unregister-app frontlinesms
|
||||
|
Loading…
Reference in New Issue
Block a user