Commit 341e6a39 authored by orangepi's avatar orangepi

OTA update

parent 113485ef
No preview for this file type
......@@ -53,10 +53,10 @@ func main() {
// 目标 URL
url := "http://47.119.190.60/api/v1/ota/latestVersion"
// 定义 conf 文件路径
confPath := "/home/orangepi/OTAdevice/version.conf"
confPath := "/home/orangepi/car/master/version.conf"
// 定义下载和备份文件路径
downloadPath := "/home/orangepi/OTAdevice/main"
backupDir := "/home/orangepi/OTAdevice/backup"
downloadPath := "/home/orangepi/car/master/main"
backupDir := "/home/orangepi/car/master/backup"
var fileData string
// 无限循环,直到成功读取到数据
......@@ -300,7 +300,7 @@ func promoteTempToFinal(tempPath, finalPath string) error {
}
func permiss() error {
cmd := exec.Command("sudo", "chmod", "+x", "/home/orangepi/OTAdevice/main")
cmd := exec.Command("sudo", "chmod", "+x", "/home/orangepi/car/master/main")
output, err := cmd.CombinedOutput()
if err != nil {
// 返回一个包含错误信息的 error 类型值
......
1.1.0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment