19 lines
460 B
Bash
19 lines
460 B
Bash
|
#!/bin/bash
|
||
|
EFI_BOOT_DIR="${EFI_BOOT_DIR:-"/boot"}";
|
||
|
BOOTLOADER_ID=${BOOTLOADER_ID:-"Arch"};
|
||
|
bootNum="$(efibootmgr | sed "/$BOOTLOADER_ID/{ s/^.*Boot\([[:digit:]]\+\)\*.*$/\1/; p; }; d")";
|
||
|
|
||
|
echo $EFI_BOOT_DIR;
|
||
|
|
||
|
yay --noconfirm -Syu secureboot-grub;
|
||
|
sudo efibootmgr --delete-bootnum --bootnum "$bootNum";
|
||
|
|
||
|
sudo sed -i \
|
||
|
-e "/esp=/{" \
|
||
|
-e "a esp=\"$EFI_BOOT_DIR\"" \
|
||
|
-e "d" \
|
||
|
-e "}" \
|
||
|
/etc/secureboot.conf;
|
||
|
|
||
|
sudo secure-grub-install;
|