#!/bin/sh git_dir=$PWD while [ ! -d .git ]; do git_dir=$(dirname "${git_dir}") done cd "${git_dir}" || exit . ./docker/bootstrap/bootstrap.env while :; do printf "DBMS (postgres|mariadb): " && read -r dbms [ $(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 printf "Admin nickname: " && read -r admin_nick printf "Admin password: " && read -r admin_password while :; do printf "Site profile (public|private|community|singleuser): " && read -r profile [ $(echo "${profile}" | grep -E 'public|private|community|singleuser') ] && break done mkdir -p ./docker/db if [ "${dbms}" = 'mariadb' ]; then printf "DB root password: " && read -r db_root_password cat > ./docker/db/db.env < ./docker/db/db.env < .env.local mkdir -p ./docker/social cat > ./docker/social/social.env <