mirror of
https://github.com/labring/sealos.git
synced 2026-09-24 15:46:19 +08:00
feature(devlop): support ssh cmd
This commit is contained in:
+1
-1
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user