Skip to content

Commit

Permalink
Add flag to specify update interval
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Alexander committed Jun 28, 2015
1 parent 1b0350e commit 4904fba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doduc-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func main() {
flagSubdomain := flag.String("subdomain", "", "the subdomain that should point to your IP address")
flagIPServer := flag.String("ip_server", "", "the doduc server")
flagToken := flag.String("token", "", "the file containing your OAuth2 token")
flagInterval := flag.Uint("interval", 300, "the interval between updates")
flag.Parse()
requireFlags(flagDomain, flagSubdomain, flagIPServer, flagToken)
token, err := ioutil.ReadFile(*flagToken)
Expand All @@ -91,6 +92,6 @@ func main() {
client := godo.NewClient(oauth2.NewClient(oauth2.NoContext, ts))
for {
update(*flagDomain, *flagSubdomain, *flagIPServer, client)
time.Sleep(5 * time.Minute)
time.Sleep(time.Duration(*flagInterval) * time.Second)
}
}

0 comments on commit 4904fba

Please sign in to comment.