fix: patch all config files (*.sh, *.list, *.conf, *.yaml, *.yml, *.json)
This commit is contained in:
parent
310ee0a8a4
commit
08653eca9d
1 changed files with 7 additions and 12 deletions
|
|
@ -259,16 +259,11 @@ func killPort(port string) {
|
||||||
|
|
||||||
func patchPaths(dir string) {
|
func patchPaths(dir string) {
|
||||||
old := "/opt/wallarm"
|
old := "/opt/wallarm"
|
||||||
// env.list (PATH, LD_LIBRARY_PATH)
|
// Patch all text config files (not binaries)
|
||||||
exec.Command("sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir),
|
for _, pattern := range []string{
|
||||||
filepath.Join(dir, "env.list")).Run()
|
"*.sh", "*.list", "*.conf", "*.yaml", "*.yml", "*.json",
|
||||||
// shell scripts
|
} {
|
||||||
exec.Command("find", dir, "-name", "*.sh", "-exec",
|
exec.Command("find", dir, "-name", pattern, "-exec",
|
||||||
"sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir), "{}", ";").Run()
|
"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()
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue