16 lines
578 B
Bash
Executable File
16 lines
578 B
Bash
Executable File
#!/bin/sh
|
|
set -ev
|
|
|
|
cd $(realpath $(dirname "${0}"))/install
|
|
|
|
# Configure OpenMapKit
|
|
export OPENMAPKIT_ADMIN_USER="admin"
|
|
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
|
mkdir -p /srv/openmapkit/omk_conf /srv/openmapkit/omk_data
|
|
chown -R 108007:108007 /srv/openmapkit/omk_data
|
|
lxc-execute openmapkit -- tar -cC /srv/openmapkit/data . | tar -xC /srv/openmapkit/omk_data
|
|
envsubst <omk_conf/settings.js >/srv/openmapkit/omk_conf/settings.js
|
|
|
|
# Register application
|
|
vmmgr register-app openmapkit omk "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"
|