initial commit
This commit is contained in:
21
src/efibootmgr.service.ts
Normal file
21
src/efibootmgr.service.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { $ } from "bun";
|
||||
import type z from "zod";
|
||||
import type { BootEntries } from "./efibootmgr.schema";
|
||||
|
||||
export class EfiBootMgrService {
|
||||
async reboot() {
|
||||
await $`reboot`;
|
||||
}
|
||||
|
||||
async setNextBoot(bootNum: string) {
|
||||
await $`efibootmgr -n ${bootNum}`;
|
||||
}
|
||||
|
||||
async listBootEntries(): Promise<z.output<typeof BootEntries>> {
|
||||
const output = await $`efibootmgr`.text();
|
||||
|
||||
console.log(output);
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user