Commit 8caf681b authored by Matt Pryor's avatar Matt Pryor
Browse files

Slight revamp of script logic

parent ee39aba1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
#!/usr/bin/bash

set -e
set -eo pipefail

#####
## This script updates the system trust roots with certificates from $ESGF_CERT_DIR
#####

test -d "$ESGF_CERT_DIR" || return
if [ ! -d "$ESGF_CERT_DIR" ]; then
    echo "[info] No certificate directory - skipping"
    return
fi

echo "[info] Linking certificates from $ESGF_CERT_DIR"
for f in $(find $ESGF_CERT_DIR -maxdepth 1 -type f); do
+4 −3
Original line number Diff line number Diff line
@@ -10,9 +10,10 @@ function fatal { echo "[fatal] $1" 1>&2; exit 1; }
#####

# If not asked to create a superuser, there is nothing to do
test "${DJANGO_CREATE_SUPERUSER:-0}" -eq 0 && \
if [ "${DJANGO_CREATE_SUPERUSER:-0}" -eq 0 ]; then
    info "Skipping Django superuser creation"
    return
fi

# We require that username and email are set
test -z "$DJANGO_SUPERUSER_USERNAME" && \
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ fi
if [ -s "$PGDATA/PG_VERSION" ]; then
    echo "[warn] $PGDATA already contains a database - skipping initialisation"
    export DB_INITIALISED=false
    return 0
    return
fi

export DB_INITIALISED=true