Skip to content

Commit

Permalink
mxgrub: Output if GRUB is already installed
Browse files Browse the repository at this point in the history
As that’s the common case, maybe it’s just spam, and should be a verbose
option.
  • Loading branch information
pmenzel committed Sep 3, 2018
1 parent a24a1da commit 5d71961
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,19 @@ sub cmd_install {

if (is_efi) {
sys 'mount','-L','ESP','/boot/efi' and exit 1;
if !(-d '/boot/efi/EFI/grub/grubx64.efi') {
if (-d '/boot/efi/EFI/grub/grubx64.efi') {
print "GRUB is already installed.\n";
}
else {
sys 'grub-install','--target=x86_64-efi',$root_disk and exit 1;
}
sys 'umount','/boot/efi' and exit 1;
} elsif ($mbr_type ne 'GRUB') {
sys 'grub-install',$root_disk and exit 1;
} else {
if ($mbr_type ne 'GRUB') {
sys 'grub-install',$root_disk and exit 1;
} else {
print "GRUB is already installed.\n";
}
}

if ($label eq 'default') {
Expand Down

0 comments on commit 5d71961

Please sign in to comment.