fixgrub.bash: check that the file in question exists first

This commit is contained in:
Aminda Suomalainen 2022-09-11 14:12:53 +03:00
parent 4f832ce013
commit c2ae326994
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q

View File

@ -5,8 +5,12 @@
# me what is going on. This is an ugly workaround.
set -x
# TODO: If this is to become more sophisciated and check for Fedora
# detect based on /boot/efi/EFI/fedora/grub.cfg, not rpmsave?
rm -f /boot/efi/EFI/fedora/grub.cfg.rpmsave
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
# This script is Fedora specific.
if [ -f /boot/efi/EFI/fedora/grub.cfg ]
then
rm -f /boot/efi/EFI/fedora/grub.cfg.rpmsave
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
fi
set +x