diff --git a/config.go b/config.go index f15bf01..524944a 100644 --- a/config.go +++ b/config.go @@ -90,6 +90,7 @@ func (c *Config) Load() error { ssh.PublicKeys(s.signer), }, HostKeyCallback: ssh.InsecureIgnoreHostKey(), + Timeout: 5 * time.Second, } s.client, err = ssh.Dial("tcp", v.Addr, s.config) @@ -97,7 +98,6 @@ func (c *Config) Load() error { if *debugFlag { log.Printf("Config.Load : ssh.Dial(%s) : %s", k, err) } - return err } else { v.online = true session, err := s.client.NewSession() @@ -168,6 +168,9 @@ func (c *Config) Load() error { if _, ok := cfg.Box[before.Box()]; !ok { return fmt.Errorf("No box defined for before : %s", string(before)) } + if !cfg.Box[before.Box()].online { + return fmt.Errorf("Before box offline for app : %s", app.Name) + } } for val, after := range app.After { _, err = regexp.Compile(val) @@ -183,6 +186,9 @@ func (c *Config) Load() error { if _, ok := cfg.Box[after.Box()]; !ok { return fmt.Errorf("No box defined for after : %s", string(after)) } + if !cfg.Box[after.Box()].online { + return fmt.Errorf("After box offline for app : %s", app.Name) + } } } diff --git a/version.go b/version.go index 6b7bf1b..4447514 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "762c538" -var buildstamp = "2022-04-16_12:55:05" -var commits = "29" -var version = "762c538-b29 - 2022-04-16_12:55:05" +var githash = "fd62711" +var buildstamp = "2022-04-16_13:08:54" +var commits = "30" +var version = "fd62711-b30 - 2022-04-16_13:08:54"