21 lines
680 B
Bash
Executable File
21 lines
680 B
Bash
Executable File
#!/bin/sh
|
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/omk
|
|
|
|
# Check prerequisites
|
|
docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh
|
|
|
|
# Build Docker container
|
|
docker build -t omk ${SOURCE_DIR}
|
|
cp ${SOURCE_DIR}/etc/init.d/omk /etc/init.d/omk
|
|
rc-update -u
|
|
|
|
# Configure OpenMapKit
|
|
export OMK_ADMIN_USER="admin"
|
|
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
|
mkdir -p /srv/omk/conf /srv/omk/data
|
|
chown -R 8007:8007 /srv/omk/data
|
|
docker run --rm -v /srv/omk/data:/mnt/data omk cp -rp /srv/omk/data/. /mnt/data
|
|
envsubst <${SOURCE_DIR}/srv/omk/conf/settings.js >/srv/omk/conf/settings.js
|
|
spotter-appmgr update-login omk "${OMK_ADMIN_USER}" "${OMK_ADMIN_PWD}"
|