Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-05-10 21:11:06 +08:00
parent b4613ae4db
commit 5f511f0399
No known key found for this signature in database
GPG Key ID: 0F84B2110C500B1F

View File

@ -68,9 +68,6 @@ func (p Plugin) Exec() error {
countHosts := len(p.Config.Host)
for _, host := range p.Config.Host {
go func(host string, counts int) {
if counts == 1 {
host = ""
}
// Create MakeConfig instance with remote username, server address and path to private key.
ssh := &easyssh.MakeConfig{
Server: host,
@ -99,6 +96,10 @@ func (p Plugin) Exec() error {
// read from the output channel until the done signal is passed
stillGoing := true
isTimeout := true
// hide host in log if only single host in config.
if counts == 1 {
host = ""
}
for stillGoing {
select {
case isTimeout = <-doneChan: