mirror of
https://codeberg.org/h3xx/you-dont-need-pihole.git
synced 2024-08-14 20:27:01 +00:00
Make make-block.pl's output more flexible
This commit is contained in:
parent
2000a11c71
commit
2496f5c5a9
1 changed files with 6 additions and 3 deletions
|
@ -53,7 +53,7 @@ sub add_host_file {
|
|||
}
|
||||
|
||||
MAIN: {
|
||||
my $out = 'block.list';
|
||||
my $out;
|
||||
my $block_ip = '0.0.0.0';
|
||||
my $workdir = &dirname($0);
|
||||
|
||||
|
@ -77,8 +77,11 @@ MAIN: {
|
|||
}
|
||||
|
||||
my $written = 0;
|
||||
open my $fho, '>', $out
|
||||
my $fho = \*STDOUT;
|
||||
if (defined $out && length $out) {
|
||||
open $fho, '>', $out
|
||||
or die "Failed to open file $out for writing: $!";
|
||||
}
|
||||
print $fho map {
|
||||
++$written;
|
||||
"$block_ip $_\n"
|
||||
|
|
Loading…
Reference in a new issue