Skip to content

Commit

Permalink
set: when doing an update loop, exit on error
Browse files Browse the repository at this point in the history
this is required to honor the dyndns protocol specification: when errors
are detected in the conf, no update should automatically retried till
the user has changed the config

Signed-off-by: Francesco Giudici <dev@foggy.day>
  • Loading branch information
fgiudici committed Dec 2, 2024
1 parent 5d4efcd commit 21ed32c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ func newSetCommand() *cli.Command {
for {
if err = updateFQDN(ddns, conf); err != nil {
slog.Error("FQDN update failed", "fqdn", conf.fqdn, "ip", conf.address, "error", err)
} else {
slog.Info("FQDN update successful", "fqdn", conf.fqdn, "ip", conf.address)
return err
}
slog.Info("FQDN update successful", "fqdn", conf.fqdn, "ip", conf.address)

if conf.interval == 0 {
return err
return nil
}
time.Sleep(conf.interval)
}
Expand Down

0 comments on commit 21ed32c

Please sign in to comment.