Skip to content

Instantly share code, notes, and snippets.

@mikfreedman
Created December 9, 2019 03:25
Show Gist options
  • Save mikfreedman/fea46985433d2aabe431569f5e3b64f4 to your computer and use it in GitHub Desktop.
Save mikfreedman/fea46985433d2aabe431569f5e3b64f4 to your computer and use it in GitHub Desktop.
Update namecheap Dynamic DNS and SSL for a given domain
#!/bin/bash
export NAMECHEAP_SOURCEIP="`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`"
export NAMECHEAP_USERNAME=".."
export NAMECHEAP_API_KEY=".."
export NAMECHEAP_DDNS_PASSWORD=".."
export HOSNTAME='..'
export DOMAIN='..'
curl "https://dynamicdns.park-your-domain.com/update?host=$HOSTNAME&domain=$DOMAIN&password=$NAMECHEAP_DDNS_PASSWORD&ip=$NAMECHEAP_SOURCEIP"
~/.acme.sh/acme.sh --issue --dns dns_namecheap -d $HOSTNAME.$DOMAIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment