mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-18 20:00:25 +08:00
提升ssh sudo安装的稳定性
This commit is contained in:
@@ -165,7 +165,14 @@ func (this *SSHClient) Mkdir(path string) error {
|
||||
}
|
||||
|
||||
func (this *SSHClient) MkdirAll(path string) error {
|
||||
return this.sftp.MkdirAll(path)
|
||||
err := this.sftp.MkdirAll(path)
|
||||
if err != nil && this.sudo {
|
||||
_, _, err2 := this.execSudo("mkdir -p "+path, this.sudoPassword)
|
||||
if err2 == nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *SSHClient) Chmod(path string, mode os.FileMode) error {
|
||||
|
||||
Reference in New Issue
Block a user