Created
May 21, 2020 17:20
-
-
Save ummdorian/e5b29a92c379b9a50271a178fbd8ad06 to your computer and use it in GitHub Desktop.
Run Drush on all Multisites Script
This file contains hidden or 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Acquia run with:
source ./drush-all.sh {drush command}