feature(devlop): support ssh cmd

This commit is contained in:
cuisongliu
2020-03-24 15:32:34 +08:00
parent d432e889b7
commit ecc731cb10
5 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ func (ss *SSH) CopyForMD5(host, localFilePath, remoteFilePath, md5 string) bool
}
func (ss *SSH) Md5Sum(host, remoteFilePath string) string {
cmd := fmt.Sprintf("md5sum %s | cut -d\" \" -f1", remoteFilePath)
remoteMD5 := ss.CmdToString(host, cmd)
remoteMD5 := ss.CmdToString(host, cmd, "")
return remoteMD5
}
+1 -1
View File
@@ -19,7 +19,7 @@ func (ss *SSH) LoggerFileSize(host, filename string, size int) {
for {
select {
case <-t.C:
length := ss.CmdToString(host, "ls -l "+filename+" | awk '{print $5}'")
length := ss.CmdToString(host, "ls -l "+filename+" | awk '{print $5}'", "")
length = strings.Replace(length, "\n", "", -1)
length = strings.Replace(length, "\r", "", -1)
lengthByte, _ := strconv.Atoi(length)