fix: license issue
This commit is contained in:
@@ -273,13 +273,13 @@ func UploadLicenseFileData(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
// backup system.ini to system.ini.bak
|
// backup system.ini to system.ini.bak
|
||||||
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
||||||
cpCmd := fmt.Sprintf("sudo test -f %s/system.ini && cp -f %s/system.ini %s/system.ini.bak",
|
cpCmd := fmt.Sprintf("sudo test -f %s/system.ini && cp -f %s/system.ini %s/system.ini.bak||echo 0",
|
||||||
neLicensePath, neLicensePath, neLicensePath)
|
neLicensePath, neLicensePath, neLicensePath)
|
||||||
cmd = exec.Command("ssh", sshHost, cpCmd)
|
cmd = exec.Command("ssh", sshHost, cpCmd)
|
||||||
out, err = cmd.CombinedOutput()
|
out, err = cmd.CombinedOutput()
|
||||||
log.Debugf("Exec output: %v", string(out))
|
log.Debugf("Exec output: %v", string(out))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Faile to execute cp command:", err)
|
log.Errorf("Faile to execute cp command:%v, cmd:%s", err, cpCmd)
|
||||||
services.ResponseInternalServerError500ProcessError(w, err)
|
services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user