Skip to content

Instantly share code, notes, and snippets.

@rlnorthcutt
Last active July 14, 2016 15:17
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 rlnorthcutt/92ce1e98cba960fcdf040e3237a42e34 to your computer and use it in GitHub Desktop.
Save rlnorthcutt/92ce1e98cba960fcdf040e3237a42e34 to your computer and use it in GitHub Desktop.
#!/bin/bash
skipped=()
# Ask user which file to use for aliases, or if to run it straight
echo "Which file contains the list of the sites that you want URLs for?"
read alias_command
if test -f $alias_command; then
oldIFS="$IFS"
IFS=$'\n' site_list=($(<$alias_command))
IFS="$oldIFS"
else
echo "No file exists with that name. Please try again."
exit
fi
echo "Checking for URLs"
# Loop through all the sites and update RestWS
for site_alias in "${site_list[@]}"
do
echo "The URL for $site_alias is:"
echo 'http://'$(drush @$site_alias status | grep "Site URI" | awk '{print $4}')
done
echo "--------------------"
echo "That should do it."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment