#!/bin/sh
set -xv
exec 1>/tmp/paperless-web.rclog 2>&1

# REQUIRE: LOGIN NETWORKING DAEMON
# KEYWORD: shutdown

. /etc/rc.subr

name="paperless-web"
rcvar="paperless-web_enable"
paperless_chdir="/usr/local/src/paperless/src"

pidfile="/var/run/paperless-web.pid"
procname="daemon"

start_cmd="/usr/sbin/daemon -r -P ${pidfile} $command"
command="/usr/local/bin/gunicorn paperless.agi:application -w 4"

load_rc_config $name
run_rc_command "$1"
