fix: add --config-file to wcli in patchPaths for multi-instance
This commit is contained in:
parent
f4e931bbd4
commit
86a172a4ed
1 changed files with 5 additions and 3 deletions
|
|
@ -255,11 +255,13 @@ func patchPaths(dir string) {
|
|||
exec.Command("bash", "-c",
|
||||
fmt.Sprintf("find %s -type f \\( -name '*.sh' -o -name '*.list' -o -name '*.conf' -o -name '*.yaml' -o -name '*.yml' -o -name '*.json' \\) -exec sed -i 's|%s|%s|g' {} +",
|
||||
dir, old, dir)).Run()
|
||||
// Unique internal ports per instance
|
||||
// Unique internal ports + wcli config-file per instance
|
||||
offset := hashPort(filepath.Base(filepath.Dir(dir)))
|
||||
exec.Command("bash", "-c",
|
||||
fmt.Sprintf("find %s -type f \\( -name '*.yaml' -o -name '*.yml' -o -name '*.conf' \\) -exec sed -i 's|:3313|:%d|g; s|:6388|:%d|g; s|:9001|:%d|g; s|:8088|:%d|g; s|:9667|:%d|g' {} +",
|
||||
dir, 3313+offset, 6388+offset, 9001+offset, 8088+offset, 9667+offset)).Run()
|
||||
fmt.Sprintf("find %s -type f \\( -name '*.yaml' -o -name '*.yml' -o -name '*.conf' \\) -exec sed -i 's|:3313|:%d|g; s|:6388|:%d|g; s|:9001|:%d|g; s|:8088|:%d|g; s|:9667|:%d|g' {} + ; "+
|
||||
"find %s -name '*.conf' -exec sed -i 's|\\(wcli run\\)$|\\1 --config-file %s/etc/wallarm/node.yaml|' {} +",
|
||||
dir, 3313+offset, 6388+offset, 9001+offset, 8088+offset, 9667+offset,
|
||||
dir, dir)).Run()
|
||||
}
|
||||
|
||||
func hashPort(s string) int {
|
||||
|
|
|
|||
Loading…
Reference in a new issue