Last active
August 22, 2021 19:53
-
-
Save JoelLisenby/79a2c8094ff3d32fc6d18b1f3c1a9708 to your computer and use it in GitHub Desktop.
A simple Dynamic DNS script for use with crontab for Linode Domain DNS Records API using dig and linode-cli from python pip
This file contains 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/bash | |
domainid=000000 | |
recordid=0000000 | |
wanip=`dig @resolver4.opendns.com myip.opendns.com +short` | |
oldip=`linode-cli domains records-view $domainid $recordid --text --no-header --format="target"` | |
if [ $oldip != $wanip ] | |
then | |
linode-cli domains records-update $domainid $recordid --target $wanip | |
else | |
echo "no ip change" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment