fix: patchPaths adds wstore.yaml, avoid corrupting binaries

This commit is contained in:
admin 2026-08-01 22:00:05 +00:00
parent 8b49978ea1
commit 310ee0a8a4

View file

@ -258,10 +258,17 @@ func killPort(port string) {
}
func patchPaths(dir string) {
exec.Command("sed", "-i", fmt.Sprintf("s|/opt/wallarm|%s|g", dir),
old := "/opt/wallarm"
// env.list (PATH, LD_LIBRARY_PATH)
exec.Command("sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir),
filepath.Join(dir, "env.list")).Run()
// shell scripts
exec.Command("find", dir, "-name", "*.sh", "-exec",
"sed", "-i", fmt.Sprintf("s|/opt/wallarm|%s|g", dir), "{}", ";").Run()
exec.Command("sed", "-i", fmt.Sprintf("s|/opt/wallarm|%s|g", dir),
"sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir), "{}", ";").Run()
// supervisord config
exec.Command("sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir),
filepath.Join(dir, "etc", "supervisord.conf")).Run()
// wstore config
exec.Command("sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir),
filepath.Join(dir, "wstore", "wstore.yaml")).Run()
}