#! /bin/bash

# Settings from /etc/sysconfig/filename are available as environment vars
# with the name 'SYS__FILENAME__KEY' (filename converted to upper case).
#
# Not all files are parsed, current list is:
#   bootloader, language
#

if [ -x /usr/sbin/grub2-mkconfig ] ; then
  if [ -d /boot/grub2 ] ; then
    ( set -x ; /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg )
  else
    echo "/boot/grub2: no such directory"
    exit 1
  fi
else
  echo "grub2-mkconfig: command not found"
  exit 1
fi

