Browse Source

lock to avoid double execution

pull/3/head
parent
commit
a06c751ac0
  1. 6
      generate-rr.pl

6
generate-rr.pl

@ -6,6 +6,7 @@ use POSIX;
use LWP;
use Net::DNS;
use Net::IPv6Addr;
use Fcntl qw( :flock );
#
# setup: as root, use one of:
@ -14,8 +15,11 @@ use Net::IPv6Addr;
# cpan LWP Net::DNS Net::IPv6Addr
#
open my $self, '<', $0;
flock( $self, LOCK_EX | LOCK_NB ) or die "Already running, exit.\n";
my $URL = 'https://pkgmaster.devuan.org/mirror_list.txt';
my $LOC = '/etc/nsd';
my $LOC = './tmp/etc/nsd';
my $ZONE = 'rr.devuan.org.zone';
my $ua = LWP::UserAgent->new;

Loading…
Cancel
Save