Skip to content

Instantly share code, notes, and snippets.

@remimikalsen
remimikalsen / updatecloudflare.sh
Last active May 24, 2024 15:52
Update your Public IP on your cloudflare domains automatically
#/bin/bash
# https://theawesomegarage.com/blog/godaddy-terminated-my-free-dns-management-api-now-what
# This script will retrieve your Public IP, and if the service IP is different from last time
# the script will attempt to call Cloudflare's specific API endpoint for DNS updates.
# I suggest calling the script from crontab like this, for example every minute:
# */1 * * * * /mnt/web/scripts/updatecloudflare.sh /mnt/web/scripts/theawesomegarage.org.cfg >> /var/log/dns-updates.log
# You will have to give a .cfg-file for each domain you want to update, formatted like this (without the comments, obviously):
@remimikalsen
remimikalsen / updateIP.sh
Last active May 24, 2024 15:52
Track your public IP and cache the updated IP locally
#/bin/bash
# https://theawesomegarage.com/blog/godaddy-terminated-my-free-dns-management-api-now-what
# This script is used to check the current IP-address, and update a cache file if needed
# The cache file is used by other scripts to check if their IP needs to be updated
# The reason for using a current IP-cache, is to reduce load on calling ipinfo.io
# which has a rate limit of 50.000 calls a month. With 5 domains, checking every 5
# minutes, that is almost 50.000 calls. With a common check, we reduce the number to
@remimikalsen
remimikalsen / updatedomeneshop.sh
Last active May 24, 2024 15:52
Dynamic DNS with Domeneshop
#/bin/bash
# https://theawesomegarage.com/blog/godaddy-terminated-my-free-dns-management-api-now-what
# This script will retrieve your Public IP, and if the service IP is different from last time
# the script will attempt to call Domeneshop's specific API endpoint for DNS updates.
# I suggest calling the script from crontab like this, for example every minute:
# */1 * * * * /path/to/updatedomeneshop.sh A @ example.com >> /var/log/dns-updates.log
# Set A record and domain to values specified by user