From 979060da69a35446289a019d00d4adbd7f176814 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 31 Oct 2018 18:02:22 +0100 Subject: [PATCH] Fix sahana-demo admin creation --- sahana-demo/install.sh | 10 +++++++--- sambro/install.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sahana-demo/install.sh b/sahana-demo/install.sh index ad6e9f2..3672ea2 100755 --- a/sahana-demo/install.sh +++ b/sahana-demo/install.sh @@ -22,9 +22,13 @@ export SAHANADEMO_HMAC=$(head -c 18 /dev/urandom | base64) export SAHANADEMO_ADMIN_USER=admin@example.com export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) envsubst /srv/sahana-demo/conf/000_config.py -mkdir -p /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users -chown -R 8001:8001 /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py -envsubst /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv +if [ ${TEMPLATE} == "default" ]; then + envsubst /srv/sahana-demo/data/default/users/masterUsers.csv +else + mkdir -p /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users + envsubst /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv + chown -R 8001:8001 /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py +fi vmmgr update-login sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}" # Replace template in LXC container mount definition diff --git a/sambro/install.sh b/sambro/install.sh index b79181d..d55bf6e 100755 --- a/sambro/install.sh +++ b/sambro/install.sh @@ -22,8 +22,8 @@ export SAMBRO_ADMIN_USER=admin@example.com export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) envsubst /srv/sambro/conf/000_config.py mkdir -p /var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users -chown -R 8001:8001 /var/lib/lxc/sambro/sambro/srv/web2py envsubst /var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv +chown -R 8001:8001 /var/lib/lxc/sambro/sambro/srv/web2py cp srv/sambro/conf/00_settings.py /srv/sambro/conf/00_settings.py cp srv/sambro/data/SAMBRO/config.py /srv/sambro/data/SAMBRO/config.py vmmgr update-login sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}"