TMP_MENU_LST=/tmp/MENU.LST.SKEL
RUN_GRUB_INSTALL=/tmp/RUN_GRUB_INSTALL
COPY_MENULST_SKEL=/tmp/COPY_MENU.LST.SKEL

# Copy the menu.lst.skel generated in CONFIGURE on to /boot/grub/menu.lst
if	[ -e ${COPY_MENULST_SKEL} ];  then
    cp  ${TMP_MENU_LST}  /boot/grub/menu.lst
fi  

if  [ -e ${RUN_GRUB_INSTALL} ];  then
    message  "${MESSAGE_COLOR}Preparing to install GRUB on ${GRUB_TARGET}...${DEFAULT_COLOR}"
    if  grub-install ${GRUB_TARGET}; then
        message "Your system should be ready to boot at this time.\n"
    else
        message "${PROBLEM_COLOR}GRUB INSTALL HAS FAILED. YOUR SYSTEM MAY BE UNBOOTABLE!!! PLEASE TRY TO INSTALL IT MANUALLY!${DEFAULT_COLOR}"
    fi
fi

# Remove temporary files
rm -f ${TMP_MENU_LST} ${RUN_GRUB_INSTALL} ${COPY_MENULST_SKEL}
