diff --git a/install/webtrees-install.sh b/install/webtrees-install.sh index c2be2e79e..69b735e46 100644 --- a/install/webtrees-install.sh +++ b/install/webtrees-install.sh @@ -47,6 +47,8 @@ msg_ok "Configured Caddy" msg_info "Automating Webtrees Setup" cd /opt/webtrees +mkdir -p /opt/webtrees/data +chown -R www-data:www-data /opt/webtrees/data WT_ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c15) $STD sudo -u www-data php /opt/webtrees/index.php config-ini \ --dbhost=127.0.0.1 \ @@ -56,6 +58,15 @@ $STD sudo -u www-data php /opt/webtrees/index.php config-ini \ --dbname=webtrees \ --tblpfx=wt_ \ --base-url="http://${LOCAL_IP}" +msg_info "Initializing Webtrees database schema" +for i in {1..15}; do + if curl -sf "http://127.0.0.1/" >/dev/null 2>&1; then + break + fi + sleep 2 +done +$STD mariadb -u webtrees -p"${MARIADB_DB_PASS}" -h 127.0.0.1 webtrees -e "SHOW TABLES LIKE 'wt_user';" | grep -q wt_user +msg_ok "Initialized Webtrees database schema" $STD sudo -u www-data php /opt/webtrees/index.php user Admin \ --create \ --real-name="Administrator" \