#!/bin/bash drupal_mail=dio@ca.ne drupal_password=porcoddio drupal_path=/var/www/d8/ drupal_db_name=www drupal_db_user=www drupal_hostname=www.example.com drupal_db_password=$(pwgen -B 16 1) . $(dirname $0)/../testingtoolchain/out.sh conf=$(dirname $0)/../config.sh [[ -f "$conf" ]] && . "$conf" set -e set -u progress "setting up MariaDB" pgrep -x mysqld || /etc/init.d/mysql start for try in {1..20}; do # elegante! if [[ -S /var/run/mysqld/mysqld.sock ]]; then break else sleep 0.2 fi done if ! mysql -u root <<<'show databases;' | fgrep -v ${drupal_db_name} then #mysqladmin create "${drupal_db_name}" mysql -u root < /etc/drush/aliases.drushrc.php '${drupal_path}', 'uri' => 'http://${drupal_hostname}', ); EOF ok "Drush configurated" progress "Download and install drupal8 'base'" if [[ ! -d ${drupal_path} ]]; then mkdir -p "$(dirname ${drupal_path})" cd "$(dirname ${drupal_path})" drush dl drupal --drupal-project-rename=$(basename ${drupal_path}) fi cd "${drupal_path}" note "Ci mette TANTO ma veramente!" drush --yes site-install --locale=it \ --account-mail=${drupal_mail} \ --account-name=techbloc-admin \ --account-pass=${drupal_password} \ --db-su=root \ --db-url="mysql://${drupal_db_user}:${drupal_db_password}@localhost/${drupal_db_name}" \ standard ok "Drupal is functional at ${drupal_path}"