run commands with sudo
This commit is contained in:
@@ -5,11 +5,11 @@ import { logger } from "./logger";
|
|||||||
|
|
||||||
export class EfiBootMgrService {
|
export class EfiBootMgrService {
|
||||||
async reboot() {
|
async reboot() {
|
||||||
await $`reboot`;
|
await $`sudo /usr/sbin/reboot`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setNextBoot(bootNum: number) {
|
async setNextBoot(bootNum: number) {
|
||||||
await $`efibootmgr -n ${bootNum}`;
|
await $`sudo /usr/bin/efibootmgr -n ${bootNum}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
parseEfiBootMgrOutput(output: string): z.output<typeof BootEntries> {
|
parseEfiBootMgrOutput(output: string): z.output<typeof BootEntries> {
|
||||||
@@ -83,7 +83,7 @@ export class EfiBootMgrService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async listBootEntries(): Promise<z.output<typeof BootEntries>> {
|
async listBootEntries(): Promise<z.output<typeof BootEntries>> {
|
||||||
const output = await $`efibootmgr`.text();
|
const output = await $`sudo /usr/bin/efibootmgr`.text();
|
||||||
|
|
||||||
logger.info(output);
|
logger.info(output);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user