#!/bin/sh
if [ -e /boot/grub/grub.cfg ]; then
  mv -n /boot/grub/grub.cfg /boot/grub/grub.cfg.old.$$ || exit 1
fi
grub-mkconfig -o /boot/grub/grub.cfg "$@"

if [ -d /sys/firmware/efi ]; then 
  windows_uefi >> /boot/grub/grub.cfg
fi