Skip to content

Instantly share code, notes, and snippets.

@delphian
Last active September 16, 2019 13:35
Show Gist options
  • Save delphian/6043424 to your computer and use it in GitHub Desktop.
Save delphian/6043424 to your computer and use it in GitHub Desktop.
Drupal site install script to install Drupal database and core. Enable and disable favorable contrib modules.
#!/bin/bash
# Site install script that will download the latest version of drupal, create
# a database in mysql, use drush to perform a site install, download
# and enable some handy contrib modules, and disable a few annoying
# core module.
#
# Copy and paste this into a shell to execute:
# curl -s https://gist.github.com/delphian/6043424/raw/ | bash
#
echo 'Name of the database? '
read DATABASE
if [ -z "$DATABASE" ]; then
DATABASE="drupal"
fi
# Create the drupal database.
mysql -h localhost -uroot -proot -e "create database $DATABASE;"
# Download drupal into the current directory.
# sudo drush dl -v -d --destination=".." --drupal-project-rename="$(basename `pwd`)" -y
# Download drupal into it's own directory.
drush dl drupal
# Install drupal.
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://root:root@localhost/$DATABASE -y
# Download extra contrib modules and disable annoying core modules.
drush dl devel, module_filter, admin_menu
drush en devel, module_filter, admin_menu -y
drush dis overlay, toolbar -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment