# only execute in case of package removal, not on upgrade
if [ $1 -eq 0 ] ; then

    getent passwd elasticsearch > /dev/null
    if [ "$?" == "0" ] ; then
        userdel elasticsearch
    fi

    getent group elasticsearch >/dev/null
    if [ "$?" == "0" ] ; then
        groupdel elasticsearch
    fi
fi

exit
