aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/hawk/files/hawk.in
blob: 19fcada9d00c1c4fb3f1a61c26f0034f0717f673 (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
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: hawk
# REQUIRE: LOGIN mysql
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# hawk_enable (bool):   Set to NO by default.
#           Set it to YES to enable hawk.

. /etc/rc.subr

name=hawk
rcvar=hawk_enable

load_rc_config hawk

: ${hawk_enable:="NO"}

command=%%PREFIX%%/sbin/hawk
command_interpreter=%%PERL%%
command_args='&'
start_precmd=find_pidfile
stop_precmd=find_pidfile

find_pidfile()
{
    if get_pidfile_from_conf pidfile %%PREFIX%%/etc/hawk/daemon.conf; then
        pidfile="$_pidfile_from_conf"
    else
        pidfile='/var/run/hawk.pid'
    fi
}

run_rc_command "$1"