post_install() {
    systemd-sysusers elasticsearch.conf
    systemd-tmpfiles --create elasticsearch.conf
}

post_upgrade(){
    systemd-tmpfiles --create elasticsearch.conf

    if [ "$(vercmp $2 5.0.0)" -lt 0 ]; then
        echo " >> "
        echo " >> Major version update. PLease take a look at breaking changes https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking-changes-5.0.html and remove incompatible plugins from /usr/share/elasticsearch/plugins"
        echo " >> "
    fi
}
