( ctx context.Context, user, target, password, keyPath, script string, stream func(string), )
| 1527 | } |
| 1528 | |
| 1529 | func executeRemoteBootstrapScript( |
| 1530 | ctx context.Context, |
| 1531 | user, target, password, keyPath, script string, |
| 1532 | stream func(string), |
| 1533 | ) (string, error) { |
| 1534 | remoteCmd := "sh -s" |
| 1535 | if !strings.EqualFold(strings.TrimSpace(user), "root") { |
| 1536 | remoteCmd = "sudo -n sh -s" |
| 1537 | } |
| 1538 | |
| 1539 | return executeSSHScript(ctx, user, target, password, keyPath, remoteCmd, script, stream) |
| 1540 | } |
| 1541 | |
| 1542 | func executeSSHScript( |
| 1543 | ctx context.Context, |
no test coverage detected