Make dual boot aliases host-specific
This commit is contained in:
13
.bash_aliases/dualboot
Normal file
13
.bash_aliases/dualboot
Normal file
@@ -0,0 +1,13 @@
|
||||
reboot_windows ()
|
||||
{
|
||||
# Check if grub is installed by checking if the command exists, if it does
|
||||
# not, then assume that the system is using systemd-boot
|
||||
if grub-install --version &>/dev/null; then
|
||||
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
|
||||
sudo grub-reboot "$windows_title"
|
||||
echo "Grub set to reboot to Windows"
|
||||
else
|
||||
sudo bootctl set-oneshot windows.conf
|
||||
echo "Systemd set to reboot to Windows"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user