-
-
Save haegrr/5892759 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
TTL=60 | |
DYNDNS_CACHE=/tmp/dyndns_cache | |
ip=$(nvram get wan_ipaddr) | |
dyndns_ip=$(cat $DYNDNS_CACHE 2>/dev/null) | |
hostname=$(nvram get wan_hostname) | |
domain=$(nvram get wan_domain) | |
if [ "x$ip" = "x$dyndns_ip" ]; then | |
echo "ip address $ip has not changed" | |
else | |
echo -n $ip > $DYNDNS_CACHE | |
AWS_ACCESS_KEY_ID=$(nvram get aws_key_id) AWS_SECRET_ACCESS_KEY=$(nvram get aws_secret_key) cli53 rrcreate $domain $hostname A $ip --ttl $TTL --replace | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment