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

if [[ -n "${PAPERLESS_CONSUMER_DISABLE}" ]]; then
	if [[ $1 -eq 0 ]]; then
		echo "[svc-consumer] Consumer is disabled, service did not run"
	else
		echo "[svc-consumer] Consumer is disabled, but service exited with error (exit code: $1, signal: $2)" >&2
	fi
else
	if [[ $1 -eq 0 ]]; then
		echo "[svc-consumer] Service stopped cleanly (exit code: $1, signal: $2)"
	else
		echo "[svc-consumer] Service exited with error (exit code: $1, signal: $2)" >&2
	fi
fi
