From c2ae326994472b9c2380995aba7776721f0b2fd7 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sun, 11 Sep 2022 14:12:53 +0300 Subject: [PATCH] fixgrub.bash: check that the file in question exists first --- bash/fixgrub.bash | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bash/fixgrub.bash b/bash/fixgrub.bash index 18fc05a..d91aa68 100755 --- a/bash/fixgrub.bash +++ b/bash/fixgrub.bash @@ -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