Skip to content

Instantly share code, notes, and snippets.

@Splint3r7
Last active December 27, 2022 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Splint3r7/aaf8b43bf8473b4849a637ba6cda23ea to your computer and use it in GitHub Desktop.
Save Splint3r7/aaf8b43bf8473b4849a637ba6cda23ea to your computer and use it in GitHub Desktop.
bash script to genereate a firewall rule for CloudFlare WAF
#!/bin/bash
filename=$1
output_str="("
while read -r line; do
output_str+="ip.src eq $line) or ("
done < "$filename"
output_str=${output_str% or (*}
echo -e "$output_str"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment