updates on rdns resolve messages
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Paul 2022-02-23 11:17:21 +01:00
parent 8512402488
commit ef228e3750

View File

@ -95,13 +95,8 @@ func ScanIP(cfg *config.Config) (err error) {
if cfg.Db.Where("rdns IS NULL").Asc("ip").Find(&orphans); len(orphans) > 0 {
for _, i := range orphans {
reverse, _ := i.UpdateRDNS()
if reverse == "" {
log.Printf("Set \"none\" rdns to IP %s\n", i.IP)
i.Rdns.String = "none"
} else {
log.Printf("%s %s\n", i.IP, reverse)
log.Printf("%s -> \"%s\"\n", i.IP, reverse)
i.Rdns.String = reverse
}
i.Rdns.Valid = true
_, err = cfg.Db.ID(i.ID).Cols("rdns").Update(&i)
if err != nil {