aboutsummaryrefslogtreecommitdiff
path: root/dyndns.go
blob: d3b47ba6414b4c69412a950d13f200af92000b65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 monitor4(update4)
	go monitor6(update6)

	for {
		select {
		case newAddr := <-update4:
			// TODO
		case newPrefix := <-update6:
			// TODO
		}
	}
}