name-dyndns/main.go

26 lines
536 B
Go
Raw Normal View History

2015-04-30 00:18:08 -04:00
package main
import (
"flag"
2015-04-30 00:18:08 -04:00
"fmt"
"github.com/mfycheng/name-dyndns/api"
"github.com/mfycheng/name-dyndns/dyndns"
2015-04-30 00:18:08 -04:00
"os"
)
func main() {
configPath := flag.String("config", "./config.json", "Specify the configuration file")
daemon := flag.Bool("daemon", false, "operate in daemon mode")
flag.Parse()
configs, err := api.LoadConfigs(*configPath)
2015-04-30 00:18:08 -04:00
if err != nil {
fmt.Println("Error loading config:", err)
os.Exit(1)
return
}
fmt.Printf("Successfully loaded %d configs\n", len(configs))
dyndns.Run(configs, *daemon)
2015-04-30 00:18:08 -04:00
}