2023-02-12 10:41:55 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Setup env variables
|
|
|
|
source ~/.env
|
2022-12-20 09:42:38 -08:00
|
|
|
|
|
|
|
# Send updated dynamic IP address to Namecheap, in order to update subdomains.
|
|
|
|
# This uses curl (separate pkg) to send the change; Namecheap automatically detects source IP if the ip field (like domain, password) ..
|
|
|
|
# is not specified.
|
|
|
|
|
|
|
|
# info helper
|
|
|
|
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
|
|
|
|
|
|
|
|
info "Starting IP update for subdomains"
|
|
|
|
|
2023-03-01 17:35:52 -08:00
|
|
|
echo "https://dynamicdns.park-your-domain.com/update?host=$DYDNS_HOST&domain=$DYDNS_DOMAIN&password=$DYDNS_PASS"
|
|
|
|
|
|
|
|
# first subdomain
|
|
|
|
curl "https://dynamicdns.park-your-domain.com/update?host=$DYDNS_HOST&domain=$DYDNS_DOMAIN&password=$DYDNS_PASS"
|
|
|
|
# second subdomain
|
|
|
|
curl "https://dynamicdns.park-your-domain.com/update?host=$DYDNS_HOST2&domain=$DYDNS_DOMAIN&password=$DYDNS_PASS"
|
2022-12-20 09:42:38 -08:00
|
|
|
|
2023-02-12 10:41:55 -08:00
|
|
|
info "IP update done"
|