Created
October 9, 2021 11:52
-
-
Save carl-alberto/174f02e9abf78d2926b86cdd4327b93f to your computer and use it in GitHub Desktop.
Terminus list all domains in an org
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 | |
# usage sh listdomains.sh ORGUUID | |
# Exit on error | |
set -e | |
# Stash org UUID | |
#ORG_UUID="99da9da0-46f1-4346-8bef-03325d645b5c" | |
VARNAME=$1 | |
# Stash list of all Pantheon sites in the org | |
#PANTHEON_SITES="$(terminus org:site:list -n ${ORG_UUID} --format=list --field=Name)" | |
PANTHEON_SITES="$(terminus org:site:list -n ${VARNAME} --format=list --field=Name)" | |
# Loop through each site in the list | |
while read -r PANTHEON_SITE_NAME; do | |
echo $PANTHEON_SITE_NAME | |
terminus site:info --format list --fields id -- $PANTHEON_SITE_NAME | |
terminus domain:list --format csv --fields id,primary $PANTHEON_SITE_NAME.live | |
echo '--------------------' | |
done <<< "$PANTHEON_SITES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment