Skip to content

Commit

Permalink
fix(v1.0): fix md5
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu committed Mar 11, 2020
1 parent a916960 commit 81d16b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sshutil/scp.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"golang.org/x/crypto/ssh"
"net"
"os"
"strings"
"time"
)

Expand All @@ -22,6 +23,8 @@ func (ss *SSH) CopyForMD5(host, localFilePath, remoteFilePath, md5 string) bool
ss.Copy(host, localFilePath, remoteFilePath)
remoteMD5 := ss.Md5Sum(host, remoteFilePath)
logger.Debug("host: %s , remote md5: %s", host, remoteMD5)
remoteMD5 = strings.TrimSpace(remoteMD5)
md5 = strings.TrimSpace(md5)
if remoteMD5 == md5 {
logger.Info("md5 validate true")
return true
Expand Down

0 comments on commit 81d16b6

Please sign in to comment.