aboutsummaryrefslogtreecommitdiff
path: root/dyndns.go
blob: f63e5c05bf47983fdb7aa8470744fbd567f1eb21 (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
// 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)

	conf := &config{}
	if err := conf.parse(*configFile); err != nil {
		log.Fatal(err)
	}

	update4 := make(chan net.IPAddr)
	update6 := make(chan net.IPNet)

	go monitor(conf, update4, update6)

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