mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-04 01:48:54 +00:00
83eb2c3700
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
45 lines
989 B
Bash
45 lines
989 B
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: davmail
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to
|
|
# enable davmail:
|
|
# davmail_enable (bool): Set to "NO" by default.
|
|
# davmail_config (path): Set to
|
|
# "%%PREFIX%%/etc/davmail.properties"
|
|
# by default
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="davmail"
|
|
rcvar=davmail_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${davmail_enable="NO"}
|
|
: ${davmail_config="%%PREFIX%%/etc/davmail.properties"}
|
|
|
|
start_cmd="${name}_start"
|
|
|
|
procname="java"
|
|
pidfile="/var/run/davmail.pid"
|
|
required_files=${davmail_config}
|
|
|
|
davmail_start()
|
|
{
|
|
if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
|
|
echo 1>&2 "${name} already running? (pid=$rc_pid)."
|
|
return 1
|
|
fi
|
|
echo "Starting ${name}."
|
|
for i in %%DATADIR%%/lib/*; do export CLASSPATH=$CLASSPATH:$i; done
|
|
java -cp %%DATADIR%%/davmail.jar:$CLASSPATH:%%JAVAJARDIR%%/swt.jar davmail.DavGateway ${davmail_config} >> /var/log/davmail-error.log 2>&1 &
|
|
echo -n $! > ${pidfile}
|
|
}
|
|
|
|
run_rc_command "$1"
|