it deletes ip.txt file when banned all ips , it works for mePHP Code:
#!/usr/bin/php -q
<?php
$TxtDosyaYol="/pathto/ip.txt";
while(1)
{
echo "working";
$IpListe=file_get_contents($TxtDosyaYol);
$IpArray=explode("\n", $IpListe);
for($i=0;$i<count($IpArray);$i++)
{
if(strlen($IpArray[$i])>5)
{
$Komut="/sbin/iptables -A INPUT -s ".$IpArray[$i]." -j DROP";
shell_exec($Komut);
}
}
unlink($TxtDosyaYol);
sleep(20); // wait 20 seconds
}
?>