1
0
mirror of https://github.com/captn3m0/Scripts.git synced 2024-09-27 22:22:53 +00:00
scripts/blacklist2hosts.php
2019-03-28 12:10:18 +05:30

14 lines
255 B
PHP
Executable File

#!/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);