#!/bin/sh -e

#DEBHELPER#

error()
{
    RET=$?
    MSG=$1
    echo "E: $MSG";
    exit $RET
}

case "$1" in
    configure)
        update-alternatives \
            --install /usr/share/plymouth/themes/default.plymouth default.plymouth \
                /usr/share/plymouth/themes/ubuntu-unity/ubuntu-unity.plymouth 200 || error "Failed to update-alternatives"

        if which update-initramfs >/dev/null 2>&1; then
            update-initramfs -u || error "Failed to update-initramfs"
        fi
        ;;

    abort-upgrade|abort-deconfigure|abort-remove)
        ;;

    *)
        echo "$0 called with unknown argument \`$1'" 1>&2
        exit 1
        ;;
esac

exit 0
