From 8d9d9a5c91036f0610a05f34fb4df4aa8bf19d7f Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 25 Oct 2011 19:08:35 -0200 Subject: countryblock - fix some file info. --- config/countryblock-dev/countryblock.inc | 2 +- config/countryblock-dev/countryblock.php | 8 ++++---- config/countryblock-dev/countryblock_sync.xml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/config/countryblock-dev/countryblock.inc b/config/countryblock-dev/countryblock.inc index c17a5d9e..2040e176 100755 --- a/config/countryblock-dev/countryblock.inc +++ b/config/countryblock-dev/countryblock.inc @@ -1,6 +1,6 @@ "/usr/loca/pkg/Africa_cidr.txt", "Oceania" => "/usr/loca/pkg/Oceania_cidr.txt", "South America"=>"/usr/loca/pkg/South_America_cidr.txt"); $cdir='/usr/local/pkg/countryblock'; +if (! is_dir($cdir)) + mkdir ($cdir,0755); foreach ($files as $cont => $file){ $ips=file_get_contents($file); $convert = explode("\n", $ips); @@ -34,8 +36,6 @@ foreach ($files as $cont => $file){ foreach ($convert as $line){ if (preg_match('/#(.*):\s+(.*)$/',$line,$matches)){ if ($ISOCode <> "" && $ISOCode <> $matches[2] && preg_match("/ISO Code/",$line)){ - if (! is_dir($cdir)) - mkdir ($cdir,755); file_put_contents($cdir.'/'.$ISOCode.'.txt',${$ISOCode},LOCK_EX); $total++; } @@ -61,8 +61,8 @@ $xml= <<