commit
48daf8a5d7
1 changed files with 18 additions and 13 deletions
31
ddclient.in
31
ddclient.in
|
@ -1226,8 +1226,7 @@ sub main {
|
|||
$SIG{'CHLD'} = 'IGNORE';
|
||||
my $pid = fork;
|
||||
if ($pid < 0) {
|
||||
print STDERR "${program}: can not fork ($!)\n";
|
||||
exit -1;
|
||||
fatal("failed to fork: %s", $!);
|
||||
} elsif ($pid) {
|
||||
exit 0;
|
||||
}
|
||||
|
@ -1665,6 +1664,7 @@ sub _read_config {
|
|||
local *FD;
|
||||
if (!open(FD, "< $file")) {
|
||||
warning("Cannot open file '%s'. (%s)", $file, $!);
|
||||
goto done;
|
||||
}
|
||||
|
||||
# If file is owned by our effective uid, ensure that it has no access for group or others.
|
||||
|
@ -1810,6 +1810,7 @@ sub _read_config {
|
|||
warning("file ends while expecting a continuation line.")
|
||||
if $continuation;
|
||||
|
||||
done:
|
||||
%$globals = %globals;
|
||||
%$config = %config;
|
||||
|
||||
|
@ -2274,17 +2275,17 @@ sub pipecmd {
|
|||
## execute the command.
|
||||
local *FD;
|
||||
if (!open(FD, $cmd)) {
|
||||
printf STDERR "%s: cannot execute command %s.\n", $program, $cmd;
|
||||
warning('cannot execute command %s.', $cmd);
|
||||
|
||||
} elsif ($stdin && (!print FD "$stdin\n")) {
|
||||
printf STDERR "%s: failed writting to %s.\n", $program, $cmd;
|
||||
warning('failed writting to %s.', $cmd);
|
||||
close(FD);
|
||||
|
||||
} elsif (!close(FD)) {
|
||||
printf STDERR "%s: failed closing %s.(%s)\n", $program, $cmd, $@;
|
||||
warning('failed closing %s. (%s)', $cmd, $@);
|
||||
|
||||
} elsif (opt('exec') && $?) {
|
||||
printf STDERR "%s: failed %s. (%s)\n", $program, $cmd, $@;
|
||||
warning('failed %s. (%s)', $cmd, $@);
|
||||
|
||||
} else {
|
||||
$ok = 1;
|
||||
|
@ -2391,6 +2392,7 @@ sub ynu {
|
|||
## warning
|
||||
## fatal
|
||||
######################################################################
|
||||
my $_in_msg = 0;
|
||||
sub _msg {
|
||||
my $fh = shift;
|
||||
my $log = shift;
|
||||
|
@ -2413,7 +2415,11 @@ sub _msg {
|
|||
print $fh $buffer;
|
||||
|
||||
$msgs .= $buffer if $log;
|
||||
logger($buffer) if $log;
|
||||
if ($log && !$_in_msg) {
|
||||
++$_in_msg; # avoid infinite recursion if logger calls _msg
|
||||
logger($buffer);
|
||||
--$_in_msg;
|
||||
}
|
||||
|
||||
}
|
||||
sub msg { _msg(*STDOUT, 0, '', @_); }
|
||||
|
@ -5205,7 +5211,7 @@ sub nic_nfsn_update {
|
|||
|
||||
my $ip = delete $config{$h}{'wantip'};
|
||||
info("setting IP address to %s for %s", $ip, $h);
|
||||
verbose("UPDATE", "updating %s", $h);
|
||||
verbose("UPDATE:", "updating %s", $h);
|
||||
|
||||
my $list_path = "/dns/$zone/listRRs";
|
||||
my $list_body = encode_www_form_urlencoded({name => $name, type => 'A'});
|
||||
|
@ -5843,7 +5849,7 @@ sub nic_godaddy_update {
|
|||
|
||||
failed("%s.%s -- Unexpected or empty service response, cannot parse data.", $hostname, $zone);
|
||||
} elsif (defined($response->{code})) {
|
||||
verbose("VERBOSE:", "%s.%s -- %s - %s.", $hostname, $zone, $response->{code}, $response->{message});
|
||||
info("%s.%s -- %s - %s.", $hostname, $zone, $response->{code}, $response->{message});
|
||||
}
|
||||
if ($ok) {
|
||||
# read data
|
||||
|
@ -7287,7 +7293,7 @@ sub nic_porkbun_update {
|
|||
# Default to the subdomain/domain being split at the first dot
|
||||
($sub_domain, $domain) = split(/\./, $host, 2);
|
||||
}
|
||||
verbose("VERBOSE:", "subdomain %s, root domain %s", $sub_domain, $domain) if $sub_domain ne '';
|
||||
info("subdomain %s, root domain %s", $sub_domain, $domain) if $sub_domain ne '';
|
||||
|
||||
foreach my $ipv ('ipv4', 'ipv6') {
|
||||
my $ip = delete $config{$host}{"want$ipv"};
|
||||
|
@ -8061,8 +8067,7 @@ sub nic_infomaniak_update {
|
|||
next;
|
||||
}
|
||||
|
||||
verbose("VERBOSE:", "setting IP address to %s for %s", $ip, $h);
|
||||
info("updating %s", $h);
|
||||
info("setting IP address to %s for %s", $ip, $h);
|
||||
|
||||
# No change in IP => nochg <w.x.y.z>
|
||||
# Bad auth => badauth
|
||||
|
@ -8091,7 +8096,7 @@ sub nic_infomaniak_update {
|
|||
my $reply;
|
||||
|
||||
foreach my $url ($url1, $url2) {
|
||||
verbose("VERBOSE:", "trying update with %s", $url);
|
||||
info("trying update with %s", $url);
|
||||
$reply = geturl(proxy => opt('proxy'), url => $url);
|
||||
if (!defined($reply) || !$reply) {
|
||||
info("could not update %s using url %s, trying next one", $h, $url);
|
||||
|
|
Loading…
Reference in a new issue