#!/bin/sh
set -e

eval_gettext() {
    if command -v gettext > /dev/null; then
        gettext "$1"
    else
        echo "$1"
    fi
}

case "$1" in
    remove)
        if [ -e /boot/grub/grub.cfg ] && command -v update-grub >/dev/null; then
            # Refresh GRUB settings
            update-grub

            # Notify that a reboot is required
            echo "*** $(eval_gettext "System restart required") ***" > /var/run/reboot-required
            echo "lowlatency-kernel" >> /var/run/reboot-required.pkgs
        fi
        ;;
esac

#DEBHELPER#
