Browse Source

Generation of smilodon admin password

Bob Mottram 7 years ago
parent
commit
944ca13f2c
1 changed files with 8 additions and 7 deletions
  1. 8
    7
      src/freedombone-app-smilodon

+ 8
- 7
src/freedombone-app-smilodon View File

@@ -79,13 +79,6 @@ function change_password_smilodon {
79 79
 }
80 80
 
81 81
 function smilodon_create_database {
82
-    if [ -f $IMAGE_PASSWORD_FILE ]; then
83
-        SMILODON_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
84
-    else
85
-        if [ ! $SMILODON_ADMIN_PASSWORD ]; then
86
-            SMILODON_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
87
-        fi
88
-    fi
89 82
     if [ ! $SMILODON_ADMIN_PASSWORD ]; then
90 83
         return
91 84
     fi
@@ -297,6 +290,14 @@ function install_smilodon {
297 290
         SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)"
298 291
     fi
299 292
 
293
+    if [ -f $IMAGE_PASSWORD_FILE ]; then
294
+        SMILODON_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
295
+    else
296
+        if [ ! $SMILODON_ADMIN_PASSWORD ]; then
297
+            SMILODON_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
298
+        fi
299
+    fi
300
+
300 301
     export smilodon_domain_name=$SMILODON_ONION_HOSTNAME
301 302
     export secret_key="$SMILODON_SECRET_KEY"
302 303
     export mongodb_username='smilodon'