#!/bin/bash

# Script kopiert pauschal die grubx64.efi nach bootx64.efi

. /etc/profile

PFAD=/boot/efi

# Nur ausfuehren wenn EFI bootx64.efi vorhanden
if [ ! -d /sys/firmware/efi ]; then exit 0; fi

mkdir -p $PFAD/EFI/Boot/

if [ -f $PFAD/EFI/debian/shimx64.efi ]; then
  # Mit SecureBoot
  cp $PFAD/EFI/debian/grubx64.efi $PFAD/EFI/Boot/
  cp $PFAD/EFI/debian/shimx64.efi $PFAD/EFI/Boot/bootx64.efi  
elif [ -f $PFAD/EFI/debian/grubx64.efi ]; then
  # ohne Secureboot
  cp $PFAD/EFI/debian/grubx64.efi $PFAD/EFI/Boot/bootx64.efi
fi




sync
exit 0

