#!/bin/sh -e

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ] ; then
    #fix misconfiguration in /etc/skel/.bashrc if it exists
	if [ -e "/etc/skel/.bashrc" ]; then
		sed -i 's/^\[ -z \$LESS \]/[ -z "\$LESS" ]/' /etc/skel/.bashrc
	fi

  #don't do anything if update-rc.d is not present
    if [ -x /usr/sbin/update-rc.d ]; then
       
		# mount efivars if needed
        if [ -x /etc/init.d/efimount ]; then
           update-rc.d efimount defaults || :
           /etc/init.d/efimount          || :
        fi
	fi
	
	if [ -e /etc/sysctl.d/99-mx_allow_non_root_dmesg.conf ]; then
		rm /etc/sysctl.d/99-mx_allow_non_root_dmesg.conf
	fi
fi

#DEBHELPER#
