Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Forked from anonymous/install_drupal.sh
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Greg-Boggs/03e4eeac029d6dd98f9c to your computer and use it in GitHub Desktop.
Save Greg-Boggs/03e4eeac029d6dd98f9c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Script to install Drupal app
# Be careful using database credentials, this script is meant to be used on development server, to speed things up.
dbuser="root"
dbpass="root"
sites_path="~/Sites"
if [ $# -lt 1 ];
then
echo "Usage: install_drupal.sh appname [dbname]"
exit
fi
appname=$1
if [ $# -eq 2 ];
then
dbname=$2
else
dbname=$1
fi
current_path=`pwd`
cd $sites_path
echo "About to installing application $appname on database $dbname."
echo "Downloading Drupal..."
drush dl drupal --drupal-project-rename=$appname
cd $appname
echo "Installing Drupal..."
drush site-install --db-url="mysql://$dbuser:$dbpass@localhost/$dbname" --site-name=$appname
echo "Done."
cd $current_path;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment