Skip to content

Instantly share code, notes, and snippets.

@trevor-atlas
Last active August 29, 2015 14:01
Show Gist options
  • Save trevor-atlas/240b8408cd944c17551a to your computer and use it in GitHub Desktop.
Save trevor-atlas/240b8408cd944c17551a to your computer and use it in GitHub Desktop.
clone drupal install.sh
#!/bin/sh
# Gets our drupal install rolling.
# place this in /usr/bin and chmod +x to make it usable globally.
# example use would be to create a site in virtualmin, cd to the root directory of the site and type "d_install"
if [ -e $1 ];
then
echo -e "\e[31mERROR: please supply site password\e[0m"
exit 1
fi
name=${PWD##*/}
pass=$1
# Make an empty dir to clone the installer into
mkdir drupal_installer
echo -e "\e[32mCloning latest installer from Github...\e[0m"
# Clone the latest installer down and copy it into the site root, so we can remove the extra directory we created earlier.
git clone -q https://gist.github.com/218ac140962d742e9593.git drupal_installer
cp drupal_installer/drupal-install.sh .
rm -Rf drupal_installer
# Remove the public html directory, Drush will rename the Drupal folder to replace this after it's downloaded.
rm -Rf public_html
# Run the installer, inject the current directory as the sitename (since we are running this from the root of the site, it will always be correct)
sh drupal-install.sh $name $pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment