Skip to content

Instantly share code, notes, and snippets.

@ummdorian
Created May 21, 2020 17:20
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 ummdorian/e5b29a92c379b9a50271a178fbd8ad06 to your computer and use it in GitHub Desktop.
Save ummdorian/e5b29a92c379b9a50271a178fbd8ad06 to your computer and use it in GitHub Desktop.
Run Drush on all Multisites Script
SITES="docroot/sites"
# Validate and hint if no argument provided.
if [ "${#}" -eq 0 ]; then
echo "- drush-all: missing argument(s)"
echo "EXAMPLE: drush-all cex -y"
else
PWD=${PWD}
cd "${SITES}"
# Loop:
for SITE in $(ls -d */ | cut -f1 -d'/'); do
# Skip default site.
if [ ! "${SITE}" == "default" ]; then
cd "${PWD}"
echo "drush -l ${SITE} ${@}"
drush -l "${SITE}" "${@}"
fi
done
fi
@ummdorian
Copy link
Author

On Acquia run with:
source ./drush-all.sh {drush command}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment