#/usr/bin/env sh AUTH_EMAIL=example@example.com AUTH_KEY=** CF Authorization key ** ZONE_ID=** CF Zone ID ** A_RECORD_NAME="dynamic" A_RECORD_ID=** CF A-record ID from cloudflare-dns-id.sh ** # Retrieve the last recorded public IP address IP_RECORD="/tmp/ip-record" RECORDED_IP=`cat $IP_RECORD` # Fetch the current public IP address PUBLIC_IP=$(curl --silent https://api.ipify.org) || exit 1 #If the public ip has not changed, nothing needs to be done, exit. if [ "$PUBLIC_IP" = "$RECORDED_IP" ]; then exit 0 fi # Otherwise, your Internet provider changed your public IP again. # Record the new public IP address locally echo $PUBLIC_IP > $IP_RECORD # Record the new public IP address on Cloudflare using API v4 RECORD=$(cat <