| 56 | * the real reboot. |
| 57 | */ |
| 58 | export 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 | |
| 69 | const aws = async (args: ReadonlyArray<string>): Promise<string> => { |
| 70 | const { stdout } = await execFileP("aws", ["--region", REGION, "--output", "text", ...args], { |