Skip to content

Commit

Permalink
Make main script universal
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Feb 3, 2021
1 parent 76d44f6 commit a8fc073
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion antizapret.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@

$| = 1;

my @ips = `fetch -o - https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv | sed 1d | LC_CTYPE=C cut -d ';' -f 1 | tr "\\|" "\\n" | sed 's/^[ \\t]*//;s/[ \\t]*\$//' | sort | uniq`;
my $fetcher = `which fetch curl wget`;
$fetcher =~ s/^(\S+)\s.*$/$1/s;
if ($fetcher =~ /fetch/) {
$fetcher .= ' -o -'
} elsif ($fetcher =~ /curl/) {
# pass
} elsif ($fetcher =~ /wget/) {
$fetcher .= ' -O -'
} else {
die "ERROR: Can't find a program to download data.";
}

my @ips = `$fetcher "https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv" | sed 1d | LC_CTYPE=C cut -d ';' -f 1 | tr "\\|" "\\n" | sed 's/^[ \\t]*//;s/[ \\t]*\$//' | sort | uniq`;

my $buf = '';
my $cnt = 0;
Expand Down

0 comments on commit a8fc073

Please sign in to comment.