ready to compare host and dns AAAA values

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-06 19:00:51 -06:00
parent 0148cec0b2
commit 53fbb4cb85
3 changed files with 24 additions and 2 deletions

15
fix.go
View File

@ -35,10 +35,21 @@ func fix() bool {
}
if ! me.status.IPv6() {
log.Warn("IPv6 DNS is broken. Check what is broken here")
log.Warn("What are my IPv6 addresses?")
log.Warn("What are the AAAA resource records in DNS?")
fixIPv6dns()
return false
}
log.Warn("YOU SHOULD BE IN IPv6 BLISS")
return true
}
func fixIPv6dns() {
log.Warn("What are my IPv6 addresses?")
for _, aaaa := range me.statusOS.GetIPv6os() {
log.Warn("FOUND AAAA ip", aaaa)
}
log.Warn("What are the AAAA resource records in DNS?")
for _, aaaa := range me.status.GetIPv6dns() {
log.Warn("FOUND AAAA ip", aaaa)
}
}

View File

@ -279,6 +279,11 @@ func (hs *hostnameStatus) missingAAAA() bool {
}
*/
func (hs *hostnameStatus) GetIPv6dns() []string {
tmp := hs.dnsAAAA.Get()
return strings.Split(tmp, "\n")
}
func (hs *hostnameStatus) updateStatus() {
if ! hs.Ready() { return }
var s string

View File

@ -3,6 +3,7 @@
package linuxstatus
import (
"strings"
"go.wit.com/log"
"go.wit.com/shell"
@ -64,6 +65,11 @@ func (ls *LinuxStatus) setHostShort() {
}
}
func (ls *LinuxStatus) GetIPv6os() []string {
tmp := me.workingIPv6.Get()
return strings.Split(tmp, "\n")
}
func lookupHostname() {
if ! me.Ready() {return}
var err error