post_install(){
 cat <<INFO

To complete the installation of this paperless fork, edit /etc/paperless.conf,
then create the database with

    sudo -u paperless paperless-manage migrate

and create a super user with

    sudo -u paperless paperless-manage createsuperuser

Paperless services can be started together with

    sudo systemctl start paperless.target

INFO
}

post_upgrade(){
 # warn the user if the provided hook is not being used
 if [ ! -e "/etc/pacman.d/hooks/paperless.hook" ]; then
  cat <<INFO

To complete the update process of paperless, you should run new migrations with

    sudo -u paperless paperless-manage migrate

This process can be automated by running once

    sudo mkdir -p /etc/pacman.d/hooks/
    sudo ln -s /usr/share/paperless/docs/paperless.hook /etc/pacman.d/hooks/

INFO
 fi

 if [ "$(vercmp "$2" "2.15.0")" -lt 0 ] && [ "$(vercmp "$1" "2.15.0")" -ge 0 ]; then
  cat <<INFO

Upgrading paperless-ngx from 2.14.x to 2.15.x requires migration of your webserver settings in /etc/paperless.conf:

    GUNICORN_CMD_ARGS='--bind=127.0.0.1:8000'

becomes:

    PAPERLESS_BIND_ADDR=127.0.0.1
    PAPERLESS_PORT=8000

INFO
 fi
}
