scripts/blacklist2hosts.php

14 lines
255 B
PHP
Raw Permalink Normal View History

2019-03-28 06:25:28 +00:00
#!/usr/bin/php
<?php
$filename= $argv[1];
$outputfile = $argv[2];
$f = fopen($outputfile, 'w');
foreach(file($filename) as $row) {
if (strlen(trim($row)) > 0 and trim($row)[0] != "#") {
fwrite($f, trim($row) . ' 0.0.0.0' . PHP_EOL);
}
}
fclose($f);