MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeShell

Method executeShell

workflow/executor.go:1030–1042  ·  view source on GitHub ↗

executeShell executes a shell command

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

1028
1029// executeShell executes a shell command
1030func (e *Executor) executeShell(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
1031 command, ok := action.Parameters["command"].(string)
1032 if !ok {
1033 return "", fmt.Errorf("command parameter required for shell")
1034 }
1035
1036 resp, err := client.ExecuteShell(ctx, beaconID, command)
1037 if err != nil {
1038 return "", err
1039 }
1040
1041 return e.waitForOutput(ctx, client, resp.TaskID)
1042}
1043
1044// executePowerShell executes a PowerShell command
1045func (e *Executor) executePowerShell(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected