add Daemon(cmd, timeout)

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-04-08 16:43:49 -07:00
parent c449abf906
commit 7048640de6
1 changed files with 7 additions and 0 deletions

View File

@ -115,3 +115,10 @@ func Run(cmdline string) int {
log.Println("END ", cmdline)
return 0
}
func Daemon(cmdline string, timeout time.Duration) int {
for {
Run(cmdline)
time.Sleep(timeout)
}
}