MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / ssh

Function ssh

e2e/src/vm/ec2.ts:283–299  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

281 const tunnelClosers: Array<() => void> = [];
282
283 const ssh = async (command: string): Promise<SshResult> => {
284 try {
285 const { stdout, stderr } = await execFileP(
286 "ssh",
287 ["-i", keyPath, ...SSH_OPTS, `${user}@${ip}`, command],
288 { maxBuffer: 64 * 1024 * 1024 },
289 );
290 return { stdout, stderr, code: 0 };
291 } catch (err) {
292 const e = err as { stdout?: string; stderr?: string; code?: number };
293 return {
294 stdout: e.stdout ?? "",
295 stderr: e.stderr ?? "",
296 code: typeof e.code === "number" ? e.code : 1,
297 };
298 }
299 };
300
301 const waitSshUp = async (attempts: number): Promise<boolean> => {
302 for (let i = 0; i < attempts; i++) {

Callers 4

waitSshUpFunction · 0.70
waitSshDownFunction · 0.70
bootTimeFunction · 0.70
ec2VmFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected