MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / runRemoteShellScript

Function runRemoteShellScript

core/app/service/logs.go:125–139  ·  view source on GitHub ↗
(url string, args ...string)

Source from the content-addressed store, hash-verified

123}
124
125func runRemoteShellScript(url string, args ...string) error {
126 statusCode, script, err := req_helper.HandleRequestWithProxy(url, http.MethodGet, constant.TimeOut20s)
127 if err != nil {
128 return err
129 }
130 if statusCode < http.StatusOK || statusCode >= http.StatusMultipleChoices {
131 return fmt.Errorf("download script failed, status code: %d", statusCode)
132 }
133 _, err = cmd.NewCommandMgr().RunPipeToFile(os.DevNull, cmd.PipeCommand{
134 Name: "sh",
135 Args: append([]string{"-s"}, args...),
136 Stdin: bytes.NewReader(script),
137 })
138 return err
139}

Callers 1

writeLogsFunction · 0.85

Calls 1

RunPipeToFileMethod · 0.45

Tested by

no test coverage detected