diff --git a/load_data.sh b/load_data.sh index 1386e0b..3021dc1 100755 --- a/load_data.sh +++ b/load_data.sh @@ -23,13 +23,6 @@ # 1. Create all the DB at once echo "Create databases..." -created_network=false -if ! docker network ls | grep -q ${MIP_PRIVATE_NETWORK} -then - docker network create ${MIP_PRIVATE_NETWORK} - created_network=true -fi - for d in ${DB_DATA} ${DB_DATASETS} do if [ ! -d ${d} ] @@ -39,6 +32,19 @@ do fi done +if [ "x0" = "x$(echo ${DB_CREATE_LIST} ${DB_SETUP_LIST} | wc -w)" ] +then + # Nothing to do, so exit + exit 0 +fi + +created_network=false +if ! docker network ls | grep -q ${MIP_PRIVATE_NETWORK} +then + docker network create ${MIP_PRIVATE_NETWORK} + created_network=true +fi + db_id=$(docker run --rm -d \ -e POSTGRES_USER="${DB_USER_ADMIN}" \ -e POSTGRES_PASSWORD="${DB_PASSWORD_ADMIN}" \