LXCize FrontlineSMS setup
This commit is contained in:
parent
7dbfe8533c
commit
01fc001990
@ -1,12 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/frontlinesms
|
||||
|
||||
# Build Docker container
|
||||
docker build -t frontlinesms ${SOURCE_DIR}
|
||||
cp ${SOURCE_DIR}/etc/init.d/frontlinesms /etc/init.d/frontlinesms
|
||||
rc-update -u
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||
|
||||
# Configure FrontlineSMS
|
||||
mkdir -p /srv/frontlinesms/data
|
||||
@ -17,3 +12,7 @@ export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base6
|
||||
envsubst <${SOURCE_DIR}/srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties
|
||||
chown -R 8018:8018 /srv/frontlinesms/data
|
||||
vmmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"
|
||||
|
||||
# Install service
|
||||
cp ${SOURCE_DIR}/etc/init.d/frontlinesms /etc/init.d/frontlinesms
|
||||
rc-update -u
|
||||
|
@ -1,17 +1,13 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="FrontlineSMS docker container"
|
||||
description="FrontlineSMS container"
|
||||
|
||||
depend() {
|
||||
need docker
|
||||
need cgroups
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/docker run -d --rm \
|
||||
--name frontlinesms \
|
||||
-h frontlinesms \
|
||||
-v /srv/frontlinesms/data:/srv/frontlinesms/.frontlinesms2 \
|
||||
frontlinesms
|
||||
lxc-start frontlinesms
|
||||
}
|
||||
|
||||
start_post() {
|
||||
@ -23,5 +19,5 @@ stop_pre() {
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/docker stop frontlinesms
|
||||
lxc-stop frontlinesms
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user