Created
December 22, 2014 21:48
-
-
Save gabesullice/67533b91b2edb63a25c1 to your computer and use it in GitHub Desktop.
Drupal Site Reset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sitereset () { | |
if [[ $# < 2 ]]; then | |
echo "You must specify at least an alias and a multisite directory name." | |
return | |
fi | |
read -p "Would you like to run updates (y/n)? " updb | |
alias=$1 | |
site=$2 | |
local_dir="$(drush drupal-directory $site)" | |
echo "cd $local_dir" | |
cd $local_dir | |
echo "drush sql-drop -y" | |
drush sql-drop -y | |
echo "drush sql-sync -y --no-cache $alias $site" | |
drush sql-sync -y --no-cache $alias $site | |
#echo "drush dis -y acquia_purge" | |
#drush dis -y acquia_purge | |
echo "drush vset --yes preprocess_css 0" | |
drush vset --yes preprocess_css 0 | |
#echo "drush vset --yes admin_menu_cache_client 0" | |
#drush vset --yes admin_menu_cache_client 0 | |
echo "drush en -y stage_file_proxy devel ${@:3}" | |
drush en -y stage_file_proxy devel dblog ${@:3} | |
if [ "$updb" == "y" ]; then | |
echo "drush updb -y" | |
drush updb -y | |
fi | |
echo "drush cc all" | |
drush cc all | |
} | |
sitereset "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment