Skip to content

Instantly share code, notes, and snippets.

@SilverCory
SilverCory / updateCloudflare.sh
Last active November 10, 2018 11:27
Make sure cloudflare is the only people who can view the site, as well as setting the realip.
#!/bin/bash
#
# Update cloudflare.conf with new IPs
#
cloudFlareConf="/etc/nginx/conf.d/cloudflare.conf"
cloudFlareList="/etc/nginx/conf.d/cloudflare-whitelist.conf"
IPV4=$(curl -s "https://www.cloudflare.com/ips-v4")
IPV6=$(curl -s "https://www.cloudflare.com/ips-v6")
DATE="$(date)"