From bc54ec59a3a6b8c615d35aebe678add5961aea0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sat, 19 Jun 2021 16:42:59 +0200 Subject: [PATCH] Added grub check --- .local/bin/Update-kernel | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/Update-kernel b/.local/bin/Update-kernel index 06e3688..9bc9c85 100755 --- a/.local/bin/Update-kernel +++ b/.local/bin/Update-kernel @@ -4,6 +4,7 @@ LOG_FILE="/tmp/update-kernel.log" BACKUP="/home/yorune/MEGA/Systems/Linux/portage" TMP_KERNEL="/tmp/kernel-config-$(uname -r)" DEFAULT_KERNEL="/usr/src/linux/.config" +GRUBRELOAD=1 function starting() { echo -e "\e[93m----------------------COMPILING------------------------------\e[0m" @@ -73,13 +74,11 @@ INITRANFS="initramfs-$KERNEL-gentoo-x86_64.img" SYSTEMMAP="System.map-$KERNEL-gentoo-x86_64" VMLINUZ="vmlinuz-$KERNEL-gentoo-x86_64" -ifchecking $INITRANFS -ifchecking $SYSTEMMAP -ifchecking $VMLINUZ -sudo grub-mkconfig -o /boot/grub/grub.cfg ifchecking "$INITRANFS" ifchecking "$SYSTEMMAP" ifchecking "$VMLINUZ" +[ "$GRUBRELOAD" -eq "1" ] && sudo grub-mkconfig -o /boot/grub/grub.cfg \ + || echo "Please check all files and regenerate grub again!" } function ifchecking () { @@ -88,6 +87,7 @@ if test -f "$FILE"; then echo "$FILE exist in the /boot folder ;)" else echo "$FILE NOT exist in the /boot folder ;)" + GRUBRELOAD=0 fi }