Browse Source

More pleroma checks

Bob Mottram 7 years ago
parent
commit
9de25b9bc7
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      src/freedombone-app-pleroma

+ 11
- 3
src/freedombone-app-pleroma View File

223
         write_config_param "PLEROMA_SECRET_KEY" "$PLEROMA_SECRET_KEY"
223
         write_config_param "PLEROMA_SECRET_KEY" "$PLEROMA_SECRET_KEY"
224
     fi
224
     fi
225
 
225
 
226
-    pleroma_secret=config/dev.secret.exs
227
-    cp config/dev.exs $pleroma_secret
226
+    if [ ! -d $PLEROMA_DIR/config ]; then
227
+        echo $"Missing directory $PLEROMA_DIR/config"
228
+        exit 7835393
229
+    fi
230
+    pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs
231
+    if [ ! -f $PLEROMA_DIR/config/dev.exs ]; then
232
+        echo $"Did not find $PLEROMA_DIR/config/dev.exs"
233
+        exit 78923528
234
+    fi
235
+    cp $PLEROMA_DIR/config/dev.exs $pleroma_secret
228
     sed -i "s|username:.*|username: \"pleroma\",|g" $pleroma_secret
236
     sed -i "s|username:.*|username: \"pleroma\",|g" $pleroma_secret
229
     sed -i "s|password:.*|password: \"$PLEROMA_ADMIN_PASSWORD\",|g" $pleroma_secret
237
     sed -i "s|password:.*|password: \"$PLEROMA_ADMIN_PASSWORD\",|g" $pleroma_secret
230
     sed -i "s|database:.*|database: \"pleroma\",|g" $pleroma_secret
238
     sed -i "s|database:.*|database: \"pleroma\",|g" $pleroma_secret
246
     fi
254
     fi
247
 
255
 
248
     cd $PLEROMA_DIR
256
     cd $PLEROMA_DIR
249
-    chown -R pleroma:pleroma *
257
+    chown -R pleroma:pleroma $PLEROMA_DIR/*
250
     sudo -u pleroma mix local.rebar --force
258
     sudo -u pleroma mix local.rebar --force
251
     if [ ! "$?" = "0" ]; then
259
     if [ ! "$?" = "0" ]; then
252
         run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
260
         run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"