diff options
| author | Jeff Carr <[email protected]> | 2019-04-08 16:43:49 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-04-08 16:43:49 -0700 |
| commit | 7048640de6155694190b548d47a19e639384c903 (patch) | |
| tree | 88cf436daa5337de4376890431bcd13343680d1d /shell.go | |
| parent | c449abf90608dd19d9b92cba6ec8b2c9501fd17e (diff) | |
add Daemon(cmd, timeout)
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'shell.go')
| -rw-r--r-- | shell.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) + } +} |
