From 9de25b9bc79ed24b20ce9a38f6542d71d289849c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 9 Jan 2018 10:37:24 +0000 Subject: [PATCH] More pleroma checks --- src/freedombone-app-pleroma | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index a1a45046..21b36123 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -223,8 +223,16 @@ function pleroma_create_database { write_config_param "PLEROMA_SECRET_KEY" "$PLEROMA_SECRET_KEY" fi - pleroma_secret=config/dev.secret.exs - cp config/dev.exs $pleroma_secret + if [ ! -d $PLEROMA_DIR/config ]; then + echo $"Missing directory $PLEROMA_DIR/config" + exit 7835393 + fi + pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs + if [ ! -f $PLEROMA_DIR/config/dev.exs ]; then + echo $"Did not find $PLEROMA_DIR/config/dev.exs" + exit 78923528 + fi + cp $PLEROMA_DIR/config/dev.exs $pleroma_secret sed -i "s|username:.*|username: \"pleroma\",|g" $pleroma_secret sed -i "s|password:.*|password: \"$PLEROMA_ADMIN_PASSWORD\",|g" $pleroma_secret sed -i "s|database:.*|database: \"pleroma\",|g" $pleroma_secret @@ -246,7 +254,7 @@ function pleroma_create_database { fi cd $PLEROMA_DIR - chown -R pleroma:pleroma * + chown -R pleroma:pleroma $PLEROMA_DIR/* sudo -u pleroma mix local.rebar --force if [ ! "$?" = "0" ]; then run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"