mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-12 14:50:25 +08:00
优化远程安装程序
This commit is contained in:
@@ -77,12 +77,12 @@ func (this *NodeInstaller) Install(dir string, params interface{}, installStatus
|
|||||||
_, err = this.client.Stat(exePath)
|
_, err = this.client.Stat(exePath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_, _, _ = this.client.Exec(exePath + " quit")
|
_, _, _ = this.client.Exec(exePath + " quit")
|
||||||
}
|
|
||||||
|
|
||||||
// 删除可执行文件防止冲突
|
// 删除可执行文件防止冲突
|
||||||
err = this.client.Remove(exePath)
|
err = this.client.Remove(exePath)
|
||||||
if err != nil && err != os.ErrNotExist {
|
if err != nil && err != os.ErrNotExist {
|
||||||
return errors.New("remove old file failed: " + err.Error())
|
return errors.New("remove old file failed: " + err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,12 +77,12 @@ func (this *NSNodeInstaller) Install(dir string, params interface{}, installStat
|
|||||||
_, err = this.client.Stat(exePath)
|
_, err = this.client.Stat(exePath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_, _, _ = this.client.Exec(exePath + " stop")
|
_, _, _ = this.client.Exec(exePath + " stop")
|
||||||
}
|
|
||||||
|
|
||||||
// 删除可执行文件防止冲突
|
// 删除可执行文件防止冲突
|
||||||
err = this.client.Remove(exePath)
|
err = this.client.Remove(exePath)
|
||||||
if err != nil && err != os.ErrNotExist {
|
if err != nil && err != os.ErrNotExist {
|
||||||
return errors.New("remove old file failed: " + err.Error())
|
return errors.New("remove old file failed: " + err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user