From 1122af152e71d4d353ff8de36807f8f8d1393244 Mon Sep 17 00:00:00 2001 From: thursday Date: Fri, 17 Sep 2021 08:28:46 +0000 Subject: Fixed shebang and simplfied if statement. --- docker/entrypoint.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'docker/entrypoint.sh') diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index abd0ed3..2a91839 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -echo << EOL +cat << EOL ------------------------------------- ____ ___ / __/__ _______/ (_) @@ -15,23 +15,20 @@ https://opencollective.com/getferdi/ EOL # Create APP key if needed -if [[ -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then - echo " " - echo "**** App Key found ****" - APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt") - echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" -elif [[ -z "${APP_KEY}" ]]; then +if [[ -z ${APP_KEY} && ! -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then echo "**** Generating Ferdi-server app key for first run ****" adonis key:generate APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2) echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt" echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" +else APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt") + echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" fi export APP_KEY node ace migration:run --force -chown -R ${PUID:-1000}:${PGID:-1000} $DATA_DIR /app +chown -R "${PUID:-1000}":"${PGID:-1000}" "$DATA_DIR" /app -su-exec ${PUID:-1000}:${PGID:-1000} node server.js +su-exec "${PUID:-1000}":"${PGID:-1000}" node server.js#!/bin/bash -- cgit v1.2.3-54-g00ecf