List api with multiple ips

CloudFlare api list help

#!/bin/bash

MY_IP=$(curl https://ifconfig.me/ip) # ideally radar.cloudflare.com/ip but dont support

AUTH_KEY="###"
AUTH_EMAIL="###"
API_ACCOUNT_ID="###"
API_LIST_ID="###"
API_ENDPOINT="https://api.cloudflare.com/client/v4/accounts/$API_ACCOUNT_ID/rules/lists/$API_LIST_ID/items"

curl -X PUT "$API_ENDPOINT" \
  -H "X-Auth-Email: $AUTH_EMAIL" \
  -H "X-Auth-Key: $AUTH_KEY" \
  -H "Content-Type: application/json" \
  --data "[{\"ip\":\"$MY_IP\"}]"
bash list-whitelist-ip.sh
Was this page helpful?