#!/bin/sh
set -e

if [ "$1" = configure ]; then

    if [ -x "$(command -v systemd-detect-virt 2>/dev/null)" ] ; then
	    systemd-detect-virt --quiet --container && is_running_in_container=true
	fi

    if [ -e /boot/grub/grub.cfg ] && [ -x "$(command -v update-grub2 2>/dev/null)" ] &&
        [ "x$is_running_in_container" != "xtrue" ] ; then
	update-grub 3>&-
    fi
fi

#DEBHELPER#
