provider automatically updates
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
8e4d24a3d0
commit
c82e88d015
22
gui.go
22
gui.go
|
@ -40,7 +40,6 @@ func debugTab(title string) {
|
|||
|
||||
g2.NewButton("dig A & AAAA DNS records (updateDNS())", func () {
|
||||
log.Log(CHANGE, "updateDNS() going to run:")
|
||||
updateDNS()
|
||||
})
|
||||
|
||||
g2 = me.debug.Box().NewGroup("debugging options")
|
||||
|
@ -197,24 +196,3 @@ func statusGrid(n *gui.Node) {
|
|||
n.NewGroup("NOTES")
|
||||
|
||||
}
|
||||
|
||||
// run everything because something has changed
|
||||
func updateDNS() {
|
||||
log.Log(CHANGE, "updateDNS() START")
|
||||
me.digStatus.Update()
|
||||
me.statusDNS.Update()
|
||||
|
||||
if me.digStatus.Ready() {
|
||||
if me.digStatus.IPv6() {
|
||||
me.statusIPv6.Set("WORKING")
|
||||
} else {
|
||||
me.statusIPv6.Set("Need VPN")
|
||||
}
|
||||
}
|
||||
|
||||
// lookup the NS records for your domain
|
||||
// if your host is test.wit.com, find the NS resource records for wit.com
|
||||
lookupNS(me.statusOS.GetDomainName())
|
||||
|
||||
log.Log(CHANGE, "updateDNS() END")
|
||||
}
|
||||
|
|
11
main.go
11
main.go
|
@ -85,9 +85,20 @@ func main() {
|
|||
// checks if your DNS records are still broken
|
||||
// if everything is working, then it just ignores
|
||||
// things until the timeout happens
|
||||
|
||||
lastProvider := "unknown"
|
||||
go myTicker(10 * time.Second, "DNSloop", func() {
|
||||
log.Log(CHANGE, "me.statusDNS.Update() START")
|
||||
me.statusDNS.Update()
|
||||
|
||||
provider := me.statusDNS.GetDNSapi()
|
||||
if provider != lastProvider {
|
||||
log.Log(CHANGE, "Your DNS API provider appears to have changed to", provider)
|
||||
lastProvider = provider
|
||||
}
|
||||
if provider == "cloudflare" {
|
||||
me.DnsAPIstatus.Set("WORKING")
|
||||
}
|
||||
})
|
||||
|
||||
// probes the OS network settings
|
||||
|
|
Loading…
Reference in New Issue