<?php if(php_sapi_name()!=='cli')die(); require_once __DIR__.'/config.php'; $pdo=getConexaoAtiva(); exec('ipset create painel_blocks hash:ip 2>/dev/null'); exec('iptables -C INPUT -m set --match-set painel_blocks src -j DROP 2>/dev/null || iptables -I INPUT -m set --match-set painel_blocks src -j DROP'); exec('ipset flush painel_blocks'); $ips=$pdo->query('SELECT ip FROM blocked_ips')->fetchAll(PDO::FETCH_COLUMN); foreach($ips as $ip) { $ip=trim($ip); if(filter_var($ip,FILTER_VALIDATE_IP)) exec('ipset add painel_blocks '.escapeshellarg($ip).' 2>/dev/null'); } ?>
