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