|
|
@@ -170,7 +170,6 @@ func yfkj_execLegacyCmd(client *Client, msg mqtt.Message) error {
|
|
|
yfkj_notifyUpgradeResult(client, "rtu", err)
|
|
|
return err
|
|
|
}
|
|
|
- defer os.Remove(filePath)
|
|
|
|
|
|
data, _ := json.Marshal(map[string]string{"result": "rtu start upgrading..."})
|
|
|
yfkj_sendResponse(client, string(data))
|
|
|
@@ -186,11 +185,13 @@ func yfkj_execLegacyCmd(client *Client, msg mqtt.Message) error {
|
|
|
utils.PlayAudioAsync(filepath.Join(baseapp.EXEC_DIR, "voices",
|
|
|
"updatefailed.wav")) /// 播报升级失败语音
|
|
|
yfkj_notifyUpgradeResult(client, "rtu", err)
|
|
|
+ _ = os.Remove(filePath)
|
|
|
return err
|
|
|
} else {
|
|
|
utils.PlayAudioAsync(filepath.Join(baseapp.EXEC_DIR, "voices",
|
|
|
"updatesuccess.wav")) // 播报升级成功语音
|
|
|
yfkj_notifyUpgradeResult(client, "rtu", nil)
|
|
|
+ _ = os.Remove(filePath)
|
|
|
os.Exit(0) // 升级完成后主动退出程序, 让守护进程重新启动新版本程序
|
|
|
}
|
|
|
default:
|