Skip to content

Instantly share code, notes, and snippets.

View ShortyDev's full-sized avatar

ShortyDev ShortyDev

  • Zell am See
View GitHub Profile
@ShortyDev
ShortyDev / ipupdate.sh
Last active February 17, 2022 14:23
Script to update your IP on a Cloudflare DNS entry
if [ ! -e address.txt ]; then
touch address.txt
echo "nothing" > address.txt
fi
read storedAddress < address.txt
dnsName=%%_CLOUDFLARE_DNS_NAME_%%
zoneId=%%_CLOUDFLARE_ZONE_ID_%%
dnsId=%%_CLOUDFLARE_DNS_ID_%%
token=%%_CLOUDFLARE_API_TOKEN_%%
apiUrl=https://api.cloudflare.com/client/v4/zones/$zoneId/dns_records/$dnsId