Add a hosts create command (#25)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-05-04 23:04:55 -04:00
1 parent 17fffe7c23
commit e3c7ca3070
8 files changed
+341 -94

No files matched your search

+10 -5
View File
@@ -25,10 +25,10 @@ type Command struct {
*base.Command
*base.Server
ShutdownCh chan struct{}
SighupCh chan struct{}
ReloadedCh chan struct{}
SigUSR2Ch chan struct{}
ExtShutdownCh chan struct{}
SighupCh chan struct{}
ReloadedCh chan struct{}
SigUSR2Ch chan struct{}
cleanupGuard sync.Once
@@ -343,9 +343,14 @@ func (c *Command) WaitForInterrupt() int {
// Wait for shutdown
shutdownTriggered := false
shutdownCh := c.ShutdownCh
if c.ExtShutdownCh != nil {
shutdownCh = c.ExtShutdownCh
}
for !shutdownTriggered {
select {
case <-c.ShutdownCh:
case <-shutdownCh:
c.UI.Output("==> Watchtower controller shutdown triggered")
if err := c.controller.Shutdown(); err != nil {