Only clean if we see the entry

This commit is contained in:
Ryan Hughes
2025-10-23 14:06:28 -04:00
parent 7c7d472e39
commit 76209ee33e

View File

@@ -1,5 +1,10 @@
echo "Cleanup extra UKI if needed to prevent errors" echo "Cleanup extra UKI if needed to prevent errors"
if [[ -f /boot/EFI/linux/omarchy_linux.efi ]] && [[ -f /boot/EFI/linux/$(cat /etc/machine-id)_linux.efi ]]; then if [[ -f /boot/EFI/linux/omarchy_linux.efi ]] && [[ -f /boot/EFI/linux/$(cat /etc/machine-id)_linux.efi ]]; then
sudo rm -f /boot/EFI/Linux/$(cat /etc/machine-id)_linux.efi
if grep -q "/boot/EFI/Linux/$(cat /etc/machine-id)_linux.efi" /boot/limine.conf; then
echo -e "Resetting limine config\n(you may need to re-add other entries via sudo limine-update)"
sudo mv /boot/limine.conf /boot/limine.conf.bak sudo mv /boot/limine.conf /boot/limine.conf.bak
sudo tee /boot/limine.conf <<EOF >/dev/null sudo tee /boot/limine.conf <<EOF >/dev/null
### Read more at config document: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md ### Read more at config document: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md
@@ -22,7 +27,7 @@ term_foreground_bright: c0caf5
term_background_bright: 24283b term_background_bright: 24283b
EOF EOF
sudo rm -f /boot/EFI/Linux/$(cat /etc/machine-id)_linux.efi
sudo limine-update sudo limine-update
sudo limine-snapper-sync sudo limine-snapper-sync
fi fi
fi