Auto Update IP Cloudflare Whitelist in my Server with CSF

Hello, I am using the CSF firewall on my server and would like it to auto update its whitelist from time to time with the new cloudlare IPs (which I also use) so that the server firewall does not block the Cloudflare. Does anyone have any command that I can do this routine (even by crontab)? Thanks

#!/usr/bin/env bash

IPS=`curl -s`
IPS+=`echo -e "\n" && curl -s`

for ip in ${IPS}; do
  sudo csf -a $ip

sudo csf -r

This topic was automatically closed after 30 days. New replies are no longer allowed.