write bash script to curl like this curl -s -o /dev/null -X POST -H 'X-Auth-Email:…
- User
write bash script
to curl like this
curl -s -o /dev/null -X POST -H 'X-Auth-Email: ' -H 'X-Auth-Key: '
2 │ -H 'Content-Type: application/json' -d '{ "mode": "block", "configuration": { "target": "ip", "value": "" } }'
3 │ https://api.cloudflare.com/client/v4/user/firewall/access_rules/rulescfuser and cftoken should be vars in this script
- Assistant
Certainly! Below is a Bash script that performs the specified
curlcommand withcfuserandcftokenas variables. You can specify the target IP address by passing it as an argument to the script.bash - User
could you add debug mode, if debug it shoud print curl return
- Assistant
Certainly! You can add a debug mode to the script that prints the full command and its response when enabled. Here’s how you can modify the existing script to include this feature: