#!/bin/bash LOGIN="your@email" PASSWORD="yourpassword" DOMAIN_ID="yourdomain.com" RECORD_ID="12345" # Replace with the Record ID IP="`curl http://jsonip.com | sed 's/{"ip":"\(.*\)"/\1/g' | sed 's/}//'`" curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -u "$LOGIN:$PASSWORD" \ -X "PUT" \ -i "https://dnsimple.com/domains/$DOMAIN_ID/records/$RECORD_ID" \ -d "{\"record\":{\"content\":\"$IP\"}}"