From 2802513f8a83f0e1c871b9ed7decb1ad7deb9c04 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 21 Jan 2018 18:11:23 -0600 Subject: [PATCH] dynamic executable name in usage, fix config example --- README.md | 2 +- main.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4f19c7d..81a2972 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ go build The config file should have a `source` endpoint and each record to be updated: ```yaml -resource: "https://api.ipify.org?format=text" +source: "https://api.ipify.org?format=text" records: - cron: "@hourly" diff --git a/main.go b/main.go index 36f8341..583dd17 100644 --- a/main.go +++ b/main.go @@ -136,7 +136,7 @@ func ScheduleJob(conf *Config, c *cron.Cron, r Record) { func main() { if len(os.Args) < 2 { - log.Printf("not enough arguments: ./home-dns config.yml") + log.Printf("not enough arguments: %s config.yml", os.Args[0]) return } @@ -148,8 +148,6 @@ func main() { return } - // open a session (first, to fail early) - // schedule cron jobs c := cron.New() for _, r := range conf.Records { @@ -159,7 +157,7 @@ func main() { stop := make(chan os.Signal) signal.Notify(stop, os.Interrupt, os.Kill) - <-stop + <-stop c.Stop() }