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

Function ec2RebootGuest

e2e/src/vm/ec2.ts:58–67  ·  view source on GitHub ↗
(
  host: string,
  keyPath: string,
  os: VmOs = "windows",
)

Source from the content-addressed store, hash-verified

56 * the real reboot.
57 */
58export const ec2RebootGuest = async (
59 host: string,
60 keyPath: string,
61 os: VmOs = "windows",
62): Promise<void> => {
63 const cmd = os === "windows" ? "Restart-Computer -Force" : "sudo reboot";
64 await execFileP("ssh", ["-i", keyPath, ...SSH_OPTS, `${guestUser(os)}@${host}`, cmd]).catch(
65 () => undefined,
66 );
67};
68
69const aws = async (args: ReadonlyArray<string>): Promise<string> => {
70 const { stdout } = await execFileP("aws", ["--region", REGION, "--output", "text", ...args], {

Callers 1

cliTargetFunction · 0.90

Calls 1

guestUserFunction · 0.85

Tested by

no test coverage detected