1
0
Fork 0

dynamic executable name in usage, fix config example

This commit is contained in:
Sean Sube 2018-01-21 18:11:23 -06:00
parent 0e0c2d5f61
commit 2802513f8a
2 changed files with 3 additions and 5 deletions

View File

@ -18,7 +18,7 @@ go build
The config file should have a `source` endpoint and each record to be updated: The config file should have a `source` endpoint and each record to be updated:
```yaml ```yaml
resource: "https://api.ipify.org?format=text" source: "https://api.ipify.org?format=text"
records: records:
- cron: "@hourly" - cron: "@hourly"

View File

@ -136,7 +136,7 @@ func ScheduleJob(conf *Config, c *cron.Cron, r Record) {
func main() { func main() {
if len(os.Args) < 2 { 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 return
} }
@ -148,8 +148,6 @@ func main() {
return return
} }
// open a session (first, to fail early)
// schedule cron jobs // schedule cron jobs
c := cron.New() c := cron.New()
for _, r := range conf.Records { for _, r := range conf.Records {
@ -159,7 +157,7 @@ func main() {
stop := make(chan os.Signal) stop := make(chan os.Signal)
signal.Notify(stop, os.Interrupt, os.Kill) signal.Notify(stop, os.Interrupt, os.Kill)
<-stop
<-stop
c.Stop() c.Stop()
} }