mirror of
https://codeberg.org/h3xx/you-dont-need-pihole.git
synced 2024-08-14 20:27:01 +00:00
Fix to make update.sh runnable from anywhere
This commit is contained in:
parent
c6f800c04a
commit
d1edd1d520
1 changed files with 5 additions and 2 deletions
|
@ -4,6 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Getopt::Long qw/ GetOptions :config no_ignore_case /;
|
||||
use File::Basename qw/ dirname /;
|
||||
|
||||
my %domains;
|
||||
my $dupes = 0;
|
||||
|
@ -54,6 +55,7 @@ sub add_host_file {
|
|||
MAIN: {
|
||||
my $out = 'block.list';
|
||||
my $block_ip = '0.0.0.0';
|
||||
my $workdir = &dirname($0);
|
||||
|
||||
unless (&GetOptions(
|
||||
'out=s' => \$out,
|
||||
|
@ -63,8 +65,9 @@ MAIN: {
|
|||
)) {
|
||||
exit 2;
|
||||
}
|
||||
my @domain_lists = glob 'lists/*.domains';
|
||||
my @hosts_lists = glob 'lists/*.hosts';
|
||||
|
||||
my @domain_lists = glob "$workdir/lists/*.domains";
|
||||
my @hosts_lists = glob "$workdir/lists/*.hosts";
|
||||
|
||||
foreach my $listfile (@domain_lists) {
|
||||
&add_domain_list($listfile);
|
||||
|
|
Loading…
Reference in a new issue