summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-07 14:19:57 -0600
committerJeff Carr <[email protected]>2024-01-07 14:19:57 -0600
commitc82e88d015adafb3f617e9d3b81e29415173316e (patch)
tree8087af079890d0636f086c43b77806dada1c81f1 /main.go
parent8e4d24a3d09db5910cb747b9dce61343d95c9cb2 (diff)
provider automatically updates
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.go b/main.go
index b5d6dd2..8dfa852 100644
--- a/main.go
+++ b/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