This script might be a useful for you if you use Digital Ocean as name server and you would update your OpenWRT based hosts with dynamic IP address.
TOKEN='digital_ocean_auth_token'
IPV4_ADDR='ipv4_addr'
DOMAIN='your.sub.domain.tld'
DATA='{"name":"'${DOMAIN}'","ip_address":"'$IPV4_ADDR'"}'
wget \
-O - \
--quiet \
--save-header \
--no-check-certificate \
--method="POST" \
--header="Content-Type: application/json" \
--header="Authorization: Bearer ${TOKEN}" \
--body-data=${DATA} "https://api.digitalocean.com/v2/domains"
TOKEN='digital_ocean_auth_token'
DOMAIN='your.sub.domain.tld'
wget \
-O - \
--quiet \
--no-check-certificate \
--method="GET" \
--header="Content-Type: application/json" \
--header="Authorization: Bearer ${TOKEN}" \
"https://api.digitalocean.com/v2/domains/${DOMAIN}/records" | jq '' | grep -B 1 '"type": "A"'
luci setting name | config file key | value |
---|---|---|
DDNS Service provider [IPv4] | --custom-- | |
Custom update-script | update_script | full path to updater script (eg: /root/ddns_digitalocean.sh) |
Hostname/Domain | domain | your domain or sub domain |
Username | username | record id of your domain or sub domain |
Password | auth_token | your Digital Ocean authentication token |