fix: patchPaths adds wstore.yaml, avoid corrupting binaries
This commit is contained in:
parent
8b49978ea1
commit
310ee0a8a4
1 changed files with 10 additions and 3 deletions
|
|
@ -258,10 +258,17 @@ func killPort(port string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func patchPaths(dir 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()
|
filepath.Join(dir, "env.list")).Run()
|
||||||
|
// shell scripts
|
||||||
exec.Command("find", dir, "-name", "*.sh", "-exec",
|
exec.Command("find", dir, "-name", "*.sh", "-exec",
|
||||||
"sed", "-i", fmt.Sprintf("s|/opt/wallarm|%s|g", dir), "{}", ";").Run()
|
"sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir), "{}", ";").Run()
|
||||||
exec.Command("sed", "-i", fmt.Sprintf("s|/opt/wallarm|%s|g", dir),
|
// supervisord config
|
||||||
|
exec.Command("sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir),
|
||||||
filepath.Join(dir, "etc", "supervisord.conf")).Run()
|
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()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue