#!/command/with-contenv /usr/bin/bash
# shellcheck shell=bash

cd ${PAPERLESS_SRC_DIR}

if [[ -n "${USER_IS_NON_ROOT}" ]]; then
	exec /usr/local/bin/celery --app paperless worker --loglevel INFO --without-mingle --without-gossip
else
	exec s6-setuidgid paperless /usr/local/bin/celery --app paperless worker --loglevel INFO --without-mingle --without-gossip
fi
