#!/bin/sh set -ev cd $(realpath $(dirname "${0}"))/install # Check prerequisites [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Populate database export ECOGIS_PWD=$(head -c 18 /dev/urandom | base64) envsubst /srv/ecogis/conf/config.php chown -R 8020:8020 /srv/ecogis/conf # Install service cp etc/init.d/ecogis /etc/init.d/ecogis rc-update -u # Stop services required for build [ ! -z ${STOP_POSTGRES} ] && service postgres stop # Register application vmmgr register-app ecogis