Create cloudflare-vmmanager.sh

This commit is contained in:
tommytran732
2021-08-13 05:27:56 -04:00
parent 66dd403f12
commit 5f7189a988
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
output(){
echo -e '\e[36m'$1'\e[0m';
}
output "Cloudflare IPWhitelist Script for VMmanager 6"
output "Copyright © 2020 Thien Tran <contact@thientran.io>."
output "Support: https://thientran.io/discord"
/usr/bin/yum -y install curl
/sbin/iptables -I DOCKER-USER -p tcp --dport 443 -j DROP
/sbin/iptables -I DOCKER-USER -p tcp -s $(curl -sSL https://www.cloudflare.com/ips-v4 | paste -d, -s) --dport 443 -j ACCEPT
output "Cloudflare IPv4s have been whitelisted on port 443!"
output "To make this persistent, run this script at startup. It will also update the list of Cloudflare's IPs."