From 08653eca9df3de6159e669a9ac69c2e856ebd354 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 1 Aug 2026 22:06:07 +0000 Subject: [PATCH] fix: patch all config files (*.sh, *.list, *.conf, *.yaml, *.yml, *.json) --- internal/native/native.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/internal/native/native.go b/internal/native/native.go index c2f0632..b93b0ea 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -259,16 +259,11 @@ func killPort(port string) { func patchPaths(dir string) { 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|%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() + // Patch all text config files (not binaries) + for _, pattern := range []string{ + "*.sh", "*.list", "*.conf", "*.yaml", "*.yml", "*.json", + } { + exec.Command("find", dir, "-name", pattern, "-exec", + "sed", "-i", fmt.Sprintf("s|%s|%s|g", old, dir), "{}", ";").Run() + } }