Skip to content

Instantly share code, notes, and snippets.

@jfrantz1-r7
Created September 17, 2019 17:42
Show Gist options
  • Save jfrantz1-r7/52ccf577ce49d207c8f66d1ad5639a70 to your computer and use it in GitHub Desktop.
Save jfrantz1-r7/52ccf577ce49d207c8f66d1ad5639a70 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# check a list of gsuite emails
if [[ $# -eq 0 ]]; then
echo 'Give me a list of emails!'
exit 1
fi
email_list="$1"
for email_address in $(cat $email_list); do
status=$(curl -s -o /dev/null -w "%{http_code}" "https://calendar.google.com/calendar/htmlembed?src=$email_address" 2> /dev/null )
if [ "$status" = 200 ]; then
printf "%s" "$email_address"
printf "\n"
else
:
fi
done < "$email_list"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment