A very simple script to add to your bash/zsh profile that shows a notification on your mac, and sends you a text message when a domain has propagated. Let's you know when to issue an SSL certificate. Great for LetsEncrypt SSL as you cannot pass the LetsEncrypt challenge until a domain has propagated.
- Only works on MacOS.
- Requires alerter to be installed for sending notifications.
- Requires
dig
- but this comes with macos so you shouldn't need to do anything there.
Add the above script to your ~/.profile or ~/.zprofile or wherever you store your terminal profile. Then close and re-open your terminal, or simply call source ~/.profile
to load in the new functionality.
Usage is very simple, call the propagate
in your terminal function with 3 arguments: the bare domain, the IP address it should point to, and your Messages id (usually your apple account email).
propagate somedomain.com 123.456.789.10 [email protected]
Always launch to the same server? Add it as a variable to your bash profile for easy reference. Do the same for your iCloud ID as well:
# ~/.profile
shared_server="123.456.789.10"
icloud_id="[email protected]"
Much easier to remember when calling the command:
propagate somedomain.com $shared_server $icloud_id
Alternatively, just hardcode these values into the propagate function itself so you only have to add 1 argument:
propagate somedomain.com
I have multiple servers, so I just check them within the propagate function (just before the while loop) and reassign as necessary. E.g.:
if [[ "$server" == "shared_server" ]]; then
server="123.456.789.10"
fi
With my Messages ID hardcoded, and my server IPs aliased via multiple if
statement like above, my command beomes thus:
propagate somedomain.com shared_server