added script to boot windows
This commit is contained in:
14
.local/bin/bootwindows
Executable file
14
.local/bin/bootwindows
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
win_bootnum=$(efibootmgr | grep -i "windows boot manager" | awk '{print $1}' | sed 's/Boot//;s/\*//')
|
||||
if [[ -z "$win_bootnum" ]]; then
|
||||
echo "Windows Boot Manager not found in UEFI boot entries."
|
||||
exit 1
|
||||
fi
|
||||
echo "Setting Windows Boot Manager (Boot$win_bootnum) as next boot"
|
||||
sudo efibootmgr -n "$win_bootnum"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Failed to set BootNext"
|
||||
exit 1
|
||||
fi
|
||||
echo "Rebooting now..."
|
||||
reboot
|
||||
Reference in New Issue
Block a user