#!/bin/sh -e

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ] ; then
	#test for live system, exit if found  (check used below)
    LIVE_CHECK=$(df -T / |tail -n1 |awk '{print $2}')
    
    if [ "$LIVE_CHECK" = "overlay" ] || [ "$LIVE_CHECK" = "aufs" ]; then
        echo "running live, do not rebuild initramfs"
    else
		#update initramfs if one of changed themes is in use
    	if [ -n "$(grep -E 'MXLiveLogo|MXImagine' /etc/plymouth/plymouthd.conf)" ]; then
		    update-initramfs -u -k all
		fi  
	fi  
fi

#DEBHELPER#
