support generating grub.cfg on systems where it is located in /boot/grub2/

This commit is contained in:
HikariKnight 2022-03-12 03:53:49 +01:00
parent 1e8d0c3c5c
commit 4954917ab2
No known key found for this signature in database
GPG key ID: E8B239063B022F5A

View file

@ -70,7 +70,14 @@ $SCRIPTDIR/backup/etc/default/grub
read -r -p "Press ENTER to continue" read -r -p "Press ENTER to continue"
sudo cp -v "$SCRIPTDIR/config/etc/default/grub" "/etc/default/grub" sudo cp -v "$SCRIPTDIR/config/etc/default/grub" "/etc/default/grub"
sudo grub-mkconfig -o "/boot/grub/grub.cfg"
# Generate grub.cfg
if [ -d "/boot/grub" ];
then
sudo grub-mkconfig -o "/boot/grub/grub.cfg"
else
sudo grub-mkconfig -o "/boot/grub2/grub.cfg"
fi
echo "" echo ""
read -r -p "Please verify there was no errors generating the grub.cfg file, then press ENTER" read -r -p "Please verify there was no errors generating the grub.cfg file, then press ENTER"