contents: |
#!/bin/bash -e
# Download list of CloudFlare ips
- wget https://www.cloudflare.com/ips-v4 -O - > /tmp/cloudflare-ips
- wget https://www.cloudflare.com/ips-v6 -O - >> /tmp/cloudflare-ips
+ wget https://www.cloudflare.com/ips-v4/ -O - > /tmp/cloudflare-ips
+ wget https://www.cloudflare.com/ips-v6/ -O - >> /tmp/cloudflare-ips
# Make into nginx commands and escape for inclusion into sed append command
CONTENTS=$(</tmp/cloudflare-ips sed 's/^/set_real_ip_from /' | sed 's/$/;/' | tr '\n' '\\' | sed 's/\\/\\n/g')