aboutsummaryrefslogtreecommitdiff
path: root/dyndns.go
diff options
context:
space:
mode:
Diffstat (limited to 'dyndns.go')
-rw-r--r--dyndns.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/dyndns.go b/dyndns.go
index 47f8513..c6f2c79 100644
--- a/dyndns.go
+++ b/dyndns.go
@@ -1,2 +1,33 @@
// dyndns is a dual-stack DynDNS client that uses the INWX JSON-RPC API.
package main
+
+import (
+ "flag"
+ "log"
+ "net"
+)
+
+func main() {
+ const usage = "override the default config path"
+ configFile := flag.String("config", "/etc/dyndns.conf", usage)
+
+ config := &config{}
+ if err := config.parse(*configFile); err != nil {
+ log.Fatal(err)
+ }
+
+ update4 := make(chan net.IPAddr)
+ update6 := make(chan net.IPNet)
+
+ go monitorIf4(update4)
+ go monitorIf6(update6)
+
+ for {
+ select {
+ case newAddr := <-update4:
+ // TODO
+ case newPrefix := <-update6:
+ // TODO
+ }
+ }
+}