#!/bin/bash # small example hook to purge 1.1.1.1's cache for all touched records for rec in "$@"; do parts=($rec) op=${parts[0]} type=${parts[1]} name=${parts[2]} if [ "$op" != "create" ]; then continue # only purge for creates fi echo "purge 1.1.1.1 $type $name" curl -X POST "https://one.one.one.one/api/v1/purge?domain=$name&type=$type" | jq -r '.msg' done