From 944ca13f2cb18a46fd4437c4018ecbfc7b90d677 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 23 Nov 2017 20:58:27 +0000 Subject: [PATCH] Generation of smilodon admin password --- src/freedombone-app-smilodon | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/freedombone-app-smilodon b/src/freedombone-app-smilodon index 155b17e8..b0f9bc5e 100755 --- a/src/freedombone-app-smilodon +++ b/src/freedombone-app-smilodon @@ -79,13 +79,6 @@ function change_password_smilodon { } function smilodon_create_database { - if [ -f $IMAGE_PASSWORD_FILE ]; then - SMILODON_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" - else - if [ ! $SMILODON_ADMIN_PASSWORD ]; then - SMILODON_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" - fi - fi if [ ! $SMILODON_ADMIN_PASSWORD ]; then return fi @@ -297,6 +290,14 @@ function install_smilodon { SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)" fi + if [ -f $IMAGE_PASSWORD_FILE ]; then + SMILODON_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" + else + if [ ! $SMILODON_ADMIN_PASSWORD ]; then + SMILODON_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" + fi + fi + export smilodon_domain_name=$SMILODON_ONION_HOSTNAME export secret_key="$SMILODON_SECRET_KEY" export mongodb_username='smilodon'