mirror of https://github.com/fail2ban/fail2ban
action.d/cloudflare-token.conf: fixes #3479, url-encode args by unban
parent
234660e94d
commit
c7f8b75e7e
|
@ -50,11 +50,12 @@ actionban = curl -s -X POST "<_cf_api_url>" \
|
||||||
# <time> unix timestamp of the ban time
|
# <time> unix timestamp of the ban time
|
||||||
# Values: CMD
|
# Values: CMD
|
||||||
#
|
#
|
||||||
actionunban = id=$(curl -s -X GET "<_cf_api_url>?mode=<cfmode>¬es=<notes>&configuration.target=<cftarget>&configuration.value=<ip>" \
|
actionunban = id=$(curl -s -X GET "<_cf_api_url>" \
|
||||||
<_cf_api_prms> \
|
--data-urlencode "mode=<cfmode>" --data-urlencode "notes=<notes>" --data-urlencode "configuration.target=<cftarget>" --data-urlencode "configuration.value=<ip>" \
|
||||||
| awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'id'\042/){print $(i+1)}}}' \
|
<_cf_api_prms> \
|
||||||
| tr -d ' "' \
|
| awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'id'\042/){print $(i+1)}}}' \
|
||||||
| head -n 1)
|
| tr -d ' "' \
|
||||||
|
| head -n 1)
|
||||||
if [ -z "$id" ]; then echo "<name>: id for <ip> cannot be found using target <cftarget>"; exit 0; fi; \
|
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" \
|
curl -s -X DELETE "<_cf_api_url>/$id" \
|
||||||
<_cf_api_prms> \
|
<_cf_api_prms> \
|
||||||
|
|
Loading…
Reference in New Issue