diff options
author | thursday <xthursdayx@mailbox.org> | 2021-09-17 08:28:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-17 08:28:46 +0000 |
commit | 1122af152e71d4d353ff8de36807f8f8d1393244 (patch) | |
tree | 4682192078030da39ab85b0b6a2f1664b7a2820f /docker/entrypoint.sh | |
parent | Update entrypoint.sh (diff) | |
download | ferdium-server-1122af152e71d4d353ff8de36807f8f8d1393244.tar.gz ferdium-server-1122af152e71d4d353ff8de36807f8f8d1393244.tar.zst ferdium-server-1122af152e71d4d353ff8de36807f8f8d1393244.zip |
Fixed shebang and simplfied if statement.
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-x | docker/entrypoint.sh | 17 |
1 files changed, 7 insertions, 10 deletions
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 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | 2 | ||
3 | echo << EOL | 3 | cat << EOL |
4 | ------------------------------------- | 4 | ------------------------------------- |
5 | ____ ___ | 5 | ____ ___ |
6 | / __/__ _______/ (_) | 6 | / __/__ _______/ (_) |
@@ -15,23 +15,20 @@ https://opencollective.com/getferdi/ | |||
15 | EOL | 15 | EOL |
16 | 16 | ||
17 | # Create APP key if needed | 17 | # Create APP key if needed |
18 | if [[ -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then | 18 | if [[ -z ${APP_KEY} && ! -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then |
19 | echo " " | ||
20 | echo "**** App Key found ****" | ||
21 | APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt") | ||
22 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" | ||
23 | elif [[ -z "${APP_KEY}" ]]; then | ||
24 | echo "**** Generating Ferdi-server app key for first run ****" | 19 | echo "**** Generating Ferdi-server app key for first run ****" |
25 | adonis key:generate | 20 | adonis key:generate |
26 | APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2) | 21 | APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2) |
27 | echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt" | 22 | echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt" |
28 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" | 23 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" |
24 | else APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt") | ||
25 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" | ||
29 | fi | 26 | fi |
30 | 27 | ||
31 | export APP_KEY | 28 | export APP_KEY |
32 | 29 | ||
33 | node ace migration:run --force | 30 | node ace migration:run --force |
34 | 31 | ||
35 | chown -R ${PUID:-1000}:${PGID:-1000} $DATA_DIR /app | 32 | chown -R "${PUID:-1000}":"${PGID:-1000}" "$DATA_DIR" /app |
36 | 33 | ||
37 | su-exec ${PUID:-1000}:${PGID:-1000} node server.js | 34 | su-exec "${PUID:-1000}":"${PGID:-1000}" node server.js#!/bin/bash |