ing
This commit is contained in:
parent
6d2a0d64e0
commit
cda77e4ad6
|
@ -32,12 +32,14 @@ func (c *SSHCrawler) InternalGet(config *configM.Config) (map[string]string, err
|
|||
commands := ""
|
||||
|
||||
for i := 0; i < itemCount; i++ {
|
||||
if "" != commands {
|
||||
commands = fmt.Sprintf("%s;echo \"--%s\";", commands, boundary)
|
||||
switch i {
|
||||
case 0:
|
||||
commands = config.Items[i].QueryInfo.Query
|
||||
default:
|
||||
commands = fmt.Sprintf("%s ; echo \"--%s\" ; %s ", commands, boundary, config.Items[i].QueryInfo.Query)
|
||||
}
|
||||
commands = fmt.Sprintf("%s;%s;", commands, config.Items[i].QueryInfo.Query)
|
||||
}
|
||||
commands = fmt.Sprintf("%s;echo \"--%s--\";", commands, boundary)
|
||||
commands = fmt.Sprintf("%s ; echo \"--%s--\" ", commands, boundary)
|
||||
|
||||
buf, err := sshClient.RunCommand(commands)
|
||||
if nil != err {
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
cuej "git.loafle.net/commons_go/util/encoding/json"
|
||||
|
@ -68,6 +69,7 @@ func (cli *SSHClient) RunCommand(command string) ([]byte, error) {
|
|||
var b bytes.Buffer
|
||||
session.Stdout = &b
|
||||
|
||||
log.Printf("%s \n", command)
|
||||
if err := session.Run(command); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user