Last active
March 1, 2022 13:28
-
-
Save gardner/8073308c5471bf3083f376bbddc4f5c0 to your computer and use it in GitHub Desktop.
Wait for a domain name to become available and then register it
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 | |
# Install the aws cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html | |
# Then configure the cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html | |
while : ; do | |
aws --region us-east-1 route53domains check-domain-availability --domain-name domain.com | grep UNAVAILABLE | |
if [ $? -ne 0 ]; then | |
aws --region us-east-1 route53domains register-domain --cli-input-json '{"DomainName":"domain.com","DurationInYears":1,"AutoRenew":true,"AdminContact":{"FirstName":"Gardner","LastName":"Bickford","ContactType":"PERSON","AddressLine1":"123 Main St","AddressLine2":"","City":"Boulder","State":"CO","CountryCode":"US","ZipCode":"80301","PhoneNumber":"+1.5555555","Email":"webmaster@spunts.net"},"RegistrantContact":{"FirstName":"Gardner","LastName":"Bickford","ContactType":"PERSON","AddressLine1":"123 Main St","AddressLine2":"","City":"Boulder","State":"CO","CountryCode":"US","ZipCode":"80301","PhoneNumber":"+1.5555555","Email":"webmaster@spunts.net"},"TechContact":{"FirstName":"Gardner","LastName":"Bickford","ContactType":"PERSON","AddressLine1":"123 Main St","AddressLine2":"","City":"Boulder","State":"CO","CountryCode":"US","ZipCode":"80301","PhoneNumber":"+1.5555555","Email":"webmaster@spunts.net"},"PrivacyProtectAdminContact":true,"PrivacyProtectRegistrantContact":true,"PrivacyProtectTechContact":true}' | |
if [ $? -eq 0 ]; then | |
exit | |
fi | |
fi | |
date | |
sleep 900 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment