Assistance to create a script to turn on bot fight mode for all zones in account

Hi All,

Has anyone created a script at all that will achieve:

  1. Connecting to my CF account and listing all active zones.

  2. Turn on bot fight mode for all zones in account (or if not this something else that is turned on for all zones in account. As from there I can amend script to botfight mode params!

If we could please post the script that would be great.

Also I am aware there is an API documentation so please no need to post a link to the API documentation as I am struggling to learn here on this aspect and need some guidance from the community please if some one could assist would be appreciated greatly!

I can’t do all the work for you, this should be a start. Just replace the DNS lookup with the bot_management endpoint.


hi @sjr appreciate that mate! awesome help. However did not work.

Please see my bash script below and thanks for bash i prefer bash!


CF_AUTH_EMAIL="[email protected]"

curl -s --request GET \
  --url \
  --header "Content-Type: application/json" \
  --header "X-Auth-Email: ${CF_AUTH_EMAIL}" \
  --header "X-Auth-Key: ${CF_AUTH_KEY}" \
 | jq -r '.result[] | "\(.id)"'

for zone_id in ${ZONE_IDS}; do 
curl -X PUT "" \
     -H "X-Auth-Email: CF_AUTH_EMAIL" \
     -H "X-Auth-Key: CF_AUTH_KEY" \
     -H "Content-Type: application/json" \
     --data '{"fight_mode":true}'
| jq .
	echo -E "${botf_on}"

However below was the output from script:

./ line 14: jq: command not found
./ line 21: unexpected EOF while looking for matching `‘’
./ line 26: syntax error: unexpected end of file

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.