change box addr for zfs send

This commit is contained in:
shoopea
2022-09-07 22:21:03 +08:00
parent 8a6fced9c8
commit f36e7da824
3 changed files with 12 additions and 7 deletions

5
box.go
View File

@@ -416,3 +416,8 @@ func (b *Box) SSHExec(cmd string) (buf *bytes.Buffer, err error) {
buf, err = b.ssh.exec(cmd)
return
}
func (b *Box) Host() string {
s := strings.Split(string(b.Addr), `:`)
return s[0]
}