From 5be901f9ce3fb87750def25d239c314c3657a624 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Fri, 5 Jun 2020 15:10:20 +0000 Subject: [PATCH] [TOOLS] Improve configure script to disallow reserved database names --- bin/configure | 16 ++++------------ docker-compose.yaml.in => docker-compose.yaml | 0 2 files changed, 4 insertions(+), 12 deletions(-) rename docker-compose.yaml.in => docker-compose.yaml (100%) diff --git a/bin/configure b/bin/configure index 5616b12616..313bc26aaf 100755 --- a/bin/configure +++ b/bin/configure @@ -7,23 +7,15 @@ done cd "${git_dir}" || exit -if [ -e ./docker/bootstrap/bootstrap.env ]; then - . ./docker/bootstrap/bootstrap.env -fi +. ./docker/bootstrap/bootstrap.env -# TODO Add configuration -cp docker-compose.yaml.in docker-compose.yaml while :; do printf "DBMS (postgres|mariadb): " && read -r dbms - echo "${dbms}" | grep -Eq 'postgres|mariadb' && break -done - -while :; do - printf "Social database name: " && read -r db - echo "${db}" | grep -vEq 'postgres' && break + [ $(echo "${dbms}" | grep -E 'postgres|mariadb') ] && break done +printf "Social database name: " && read -r db [ "${dbms}" = 'mariadb' ] && printf "Database user: " && read -r user printf "Database password: " && read -r password printf "Sitename: " && read -r sitename @@ -32,7 +24,7 @@ printf "Admin password: " && read -r admin_password while :; do printf "Site profile (public|private|community|single_user): " && read -r profile - echo "${profile}" | grep -Eq 'public|private|community|single_user' && break + [ $(echo "${profile}" | grep -E 'public|private|community|single_user') ] && break done mkdir -p ./docker/db diff --git a/docker-compose.yaml.in b/docker-compose.yaml similarity index 100% rename from docker-compose.yaml.in rename to docker-compose.yaml