#!/bin/sh # Created by: Mark Felder # $FreeBSD$ # # PROVIDE: radicale # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable radicale: # radicale_enable (bool): Set to "NO" by default. # Set it to "YES" to enable radicale. # . /etc/rc.subr name=radicale rcvar=radicale_enable # set defaults load_rc_config $name : ${radicale_enable:=NO} : ${radicale_config=%%PREFIX%%/etc/radicale/config} : ${radicale_user=%%USERS%%} pidfile=/var/run/radicale/radicale.pid command=%%PREFIX%%/bin/radicale command_args="-d -p ${pidfile} -C ${radicale_config}" command_interpreter=%%PYTHON_CMD%% required_files=${radicale_config} start_precmd=do_precmd do_precmd() { if [ ! -d ${pidfile%/*} ]; then install -d -o ${radicale_user} ${pidfile%/*} fi } run_rc_command "$1"