aboutsummaryrefslogtreecommitdiffstats
path: root/java/avis/files/avisd.in
blob: 2b1c9f0671e3fb850a0142bbd28279adcdcc686d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: avisd
# REQUIRE: LOGIN
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable `avisd':
#
#avisd_enable  (bool): Set to NO by default
#              Set to YES to enable avisd
#avisd_config  (path): Set to %%PREFIX%%/etc/avisd.conf
#              by default
#avisd_flags (params): Set to -daemon
#              by default
#avisd_pidfile (path): Set to /var/run/avisd.pid
#              by default
#avisd_logfile (path): Set to /var/log/avis.log
#              by default
#

. /etc/rc.subr

name="avisd"
rcvar=`set_rcvar`

command=%%PREFIX%%/sbin/avisd
command_interpreter=/bin/sh
required_files="%%PREFIX%%/etc/avisd.conf"

# read configuration and set defaults
load_rc_config "$name"

: ${avisd_enable="NO"}
: ${avisd_pidfile="/var/run/avisd.pid"}
: ${avisd_flags="-daemon"}
: ${avisd_config="%%PREFIX%%/etc/avisd.conf"}
: ${avisd_logfile="/var/log/avisd.log"}

pidfile="$avisd_pidfile"
command_args="-c $avisd_config $avisd_flags -pidfile $pidfile -logfile $avisd_logfile"

run_rc_command "$1"