Skip to content

Commit 81d16b6

Browse files
committed
fix(v1.0): fix md5
1 parent a916960 commit 81d16b6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/sshutil/scp.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"golang.org/x/crypto/ssh"
99
"net"
1010
"os"
11+
"strings"
1112
"time"
1213
)
1314

@@ -22,6 +23,8 @@ func (ss *SSH) CopyForMD5(host, localFilePath, remoteFilePath, md5 string) bool
2223
ss.Copy(host, localFilePath, remoteFilePath)
2324
remoteMD5 := ss.Md5Sum(host, remoteFilePath)
2425
logger.Debug("host: %s , remote md5: %s", host, remoteMD5)
26+
remoteMD5 = strings.TrimSpace(remoteMD5)
27+
md5 = strings.TrimSpace(md5)
2528
if remoteMD5 == md5 {
2629
logger.Info("md5 validate true")
2730
return true

0 commit comments

Comments
 (0)