[TOOLS] Improve configure script to disallow reserved database names

This commit is contained in:
Hugo Sales 2020-06-05 15:10:20 +00:00 committed by Hugo Sales
parent dc7387cc8d
commit 5be901f9ce
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 4 additions and 12 deletions

16
bin/configure vendored
View File

@ -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