diff options
author | Sergey G. Brester <serg.brester@sebres.de> | 2023-04-13 19:09:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 19:09:00 +0200 |
commit | e73748c4422196d7e40b9e3a1d5c6cf2e81d49c1 (patch) | |
tree | 8d332b7509b70c40c55c3f699d95b39f961b31e0 /config/action.d/cloudflare-token.conf | |
parent | 7dc32971f8fa9fb4b4260e4a641aaedde68756d2 (diff) | |
parent | 27294c4b9ee5d5568a1d5f83af744ea39d5a1acb (diff) | |
download | fail2ban-e73748c4422196d7e40b9e3a1d5c6cf2e81d49c1.tar.gz |
Merge branch 'master' into mikrotik
Diffstat (limited to 'config/action.d/cloudflare-token.conf')
-rw-r--r-- | config/action.d/cloudflare-token.conf | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/config/action.d/cloudflare-token.conf b/config/action.d/cloudflare-token.conf index 8c5c37de..287621eb 100644 --- a/config/action.d/cloudflare-token.conf +++ b/config/action.d/cloudflare-token.conf @@ -50,11 +50,12 @@ actionban = curl -s -X POST "<_cf_api_url>" \ # <time> unix timestamp of the ban time # Values: CMD # -actionunban = id=$(curl -s -X GET "<_cf_api_url>?mode=<cfmode>¬es=<notes>&configuration.target=<cftarget>&configuration.value=<ip>" \ - <_cf_api_prms> \ - | awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'id'\042/){print $(i+1)}}}' \ - | tr -d ' "' \ - | head -n 1) +actionunban = id=$(curl -s -X GET "<_cf_api_url>" \ + --data-urlencode "mode=<cfmode>" --data-urlencode "notes=<notes>" --data-urlencode "configuration.target=<cftarget>" --data-urlencode "configuration.value=<ip>" \ + <_cf_api_prms> \ + | awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'id'\042/){print $(i+1)}}}' \ + | tr -d ' "' \ + | head -n 1) if [ -z "$id" ]; then echo "<name>: id for <ip> cannot be found using target <cftarget>"; exit 0; fi; \ curl -s -X DELETE "<_cf_api_url>/$id" \ <_cf_api_prms> \ |