Allow the path to /pgadmin4/servers.json to be overridden in the container distribution. Fixes #4400

This commit is contained in:
Andrew Coleman
2019-06-27 10:56:37 -04:00
committed by Dave Page
parent da8cf14047
commit d397959f6a
3 changed files with 11 additions and 2 deletions

View File

@@ -15,9 +15,10 @@ if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
# Importing pgadmin4 (from this script) is enough
python run_pgadmin.py
export PGADMIN_SERVER_JSON_FILE=${PGADMIN_SERVER_JSON:-/pgadmin4/servers.json}
# Pre-load any required servers
if [ -f /pgadmin4/servers.json ]; then
/usr/local/bin/python /pgadmin4/setup.py --load-servers /pgadmin4/servers.json --user ${PGADMIN_DEFAULT_EMAIL}
if [ -f "${PGADMIN_SERVER_JSON_FILE}" ]; then
/usr/local/bin/python /pgadmin4/setup.py --load-servers "${PGADMIN_SERVER_JSON_FILE}" --user ${PGADMIN_DEFAULT_EMAIL}
fi
fi