fix(fail2ban): Use https protocol to get the server IP

This commit is contained in:
Pratik Tripathy
2025-10-11 19:42:22 +05:30
parent dcb2b4c340
commit 6e5f3c1be5

View File

@@ -758,7 +758,7 @@ fail2ban_jail_settings() {
# Get server's public IP
file_log "Getting server's public IP..."
PUBLIC_IP=$(curl -s -4 ifconfig.me 2>&1 || curl -s -4 icanhazip.com 2>&1 || curl -s -4 ipinfo.io/ip 2>&1)
PUBLIC_IP=$(curl -s -4 --max-time 10 --fail https://ifconfig.me 2>&1)
file_log "INFO" "Server public IP: $PUBLIC_IP"
file_log "INFO" "Adding jails to $JAIL_LOCAL..."