2023-04-01 11:01:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
EFI_BOOT_DIR="${EFI_BOOT_DIR}";
|
|
|
|
BOOTLOADER_ID="${BOOTLOADER_ID}";
|
2023-04-01 13:17:26 +00:00
|
|
|
|
2023-04-03 08:50:10 +00:00
|
|
|
# Elevate script
|
|
|
|
if [ ! "$UID" -eq 0 ]
|
|
|
|
then
|
2023-07-13 21:10:31 +00:00
|
|
|
sudo \
|
2023-04-03 08:50:10 +00:00
|
|
|
EFI_BOOT_DIR="${EFI_BOOT_DIR}" \
|
|
|
|
BOOTLOADER_ID="${BOOTLOADER_ID}" \
|
|
|
|
bash "$BASH_SOURCE" "$USER";
|
|
|
|
else
|
2023-07-13 19:05:39 +00:00
|
|
|
sed -i "s/#\(GRUB_DISABLE_OS_PROBER\)/\1/" /etc/default/grub;
|
2023-04-03 08:50:10 +00:00
|
|
|
grub-install --target=x86_64-efi --efi-directory="$EFI_BOOT_DIR" --bootloader-id="$BOOTLOADER_ID";
|
|
|
|
grub-mkconfig -o "$EFI_BOOT_DIR/grub/grub.cfg";
|
|
|
|
fi;
|