Last active
May 21, 2021 07:59
-
-
Save vvdaal/daa206ed33abd3577af774944c350bd5 to your computer and use it in GitHub Desktop.
Bash script for fixing the IPv6 issue with Terraform on Google Cloud Shell
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 | |
# | |
#Make root the owner of this file and execute in your .bashrc with sudo ./fix_hosts_google_shell.sh | |
#Make sure sudo uses passwordless auth | |
# | |
if grep -q "googleapis.com" /etc/hosts | |
then | |
echo "Googleapis detected in /etc/hosts, skipping bug workaround for connectivity" | |
exit 1 | |
#Exists so exit script | |
else | |
export APIS="googleapis.com www.googleapis.com storage.googleapis.com iam.googleapis.com container.googleapis.com cloudresourcemanager.googleapis.com compute.googleapis.com pubsub.googleapis.com secretmanager.googleapis.com" | |
for i in $APIS | |
do | |
echo "199.36.153.10 $i" >> /etc/hosts | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment