From 306cca2fec2d3d3d1e4c15bd5b40638e743227a1 Mon Sep 17 00:00:00 2001 From: "Jiao, Joey" Date: Mon, 7 Apr 2025 13:24:37 +0800 Subject: vm/adb: run script allows executing complex script --- vm/adb/adb.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'vm/adb') diff --git a/vm/adb/adb.go b/vm/adb/adb.go index 77b0a8c55..ac93bc292 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -424,13 +424,7 @@ func (inst *instance) repair() error { func (inst *instance) runScript(script string) error { log.Logf(2, "adb: executing %s", script) - // Execute the contents of the script. - contents, err := os.ReadFile(script) - if err != nil { - return fmt.Errorf("unable to read %s: %w", script, err) - } - c := string(contents) - output, err := osutil.RunCmd(5*time.Minute, "", "sh", "-c", c) + output, err := osutil.RunCmd(5*time.Minute, "", "sh", script) if err != nil { return fmt.Errorf("failed to execute %s: %w", script, err) } -- cgit mrf-deployment