|
|
|
@ -59,13 +59,13 @@ actionban = curl -s -o /dev/null -X POST <_cf_api_prms> \
|
|
|
|
|
#actionunban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
|
|
|
# API v4
|
|
|
|
|
actionunban = id=$(curl -s -X GET <_cf_api_prms> \
|
|
|
|
|
"<_cf_api_url>?mode=block&configuration_target=ip&configuration_value=<ip>&page=1&per_page=1¬es=Fail2Ban%20<name>" \
|
|
|
|
|
"<_cf_api_url>?mode=block&configuration_target=ip&configuration_value=<ip>&page=1&per_page=1¬es=Fail2Ban%%20<name>" \
|
|
|
|
|
| jq -r '.result[0].id')
|
|
|
|
|
if [ -z "$id" ]; then echo "<name>: id for <ip> cannot be found"; exit 0; fi;
|
|
|
|
|
curl -s -o /dev/null -X DELETE <_cf_api_prms> "<_cf_api_url>/$id"
|
|
|
|
|
|
|
|
|
|
_cf_api_url = https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules
|
|
|
|
|
_cf_api_prms = -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cfkey>' -H 'Content-Type: application/json'
|
|
|
|
|
_cf_api_prms = -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' -H 'Content-Type: application/json'
|
|
|
|
|
|
|
|
|
|
[Init]
|
|
|
|
|
|
|
|
|
|