démon un peu plus simple, message d'erreur si pas d'IP trouvée
This commit is contained in:
parent
c7fa0c08f6
commit
78cf8306a9
@ -30,20 +30,15 @@ our $type = 'A'; # could be AAAA
|
|||||||
our $cacert = "ca.cert";
|
our $cacert = "ca.cert";
|
||||||
|
|
||||||
sub get_ip {
|
sub get_ip {
|
||||||
my @tmp_ip = split "\n", `wget -nv -O - $checkip`;
|
for (split "\n", `wget -nv -O - $checkip`) {
|
||||||
my $ip;
|
/^[0-9.]+$/ || /^[0-9a-f:]+$/ and return $_
|
||||||
|
|
||||||
for(@tmp_ip) {
|
|
||||||
if($_ =~ /^[0-9.]+$/ || $_ =~ /^[0-9a-f:]+$/) {
|
|
||||||
$ip = $_;
|
|
||||||
}
|
}
|
||||||
}
|
undef
|
||||||
|
|
||||||
$ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub update {
|
sub update {
|
||||||
my $ip = get_ip;
|
my $ip = get_ip;
|
||||||
|
die "Can't get your IP address !" unless $ip;
|
||||||
|
|
||||||
say "UPDATE :: domain $name.$domain => IP $ip, type $type";
|
say "UPDATE :: domain $name.$domain => IP $ip, type $type";
|
||||||
my $passb64 = encode_base64($pass);
|
my $passb64 = encode_base64($pass);
|
||||||
|
Reference in New Issue
Block a user