summaryrefslogtreecommitdiff
path: root/security/razorback-masterNugget/files/masterNugget.in
blob: 33e1794390f37d8ff82c0676cb8b49405d73e8d3 (plain)
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
#!/bin/sh

# PROVIDE: masterNugget
# REQUIRE: dispatcher clamd
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable the razorback master nugget:
#
# masterNugget_enable="YES"

. /etc/rc.subr

name=masterNugget
rcvar=masterNugget_enable

load_rc_config $name

masterNugget_enable=${masterNugget_enable:-"NO"}
masterNugget_user=${masterNugget_user:-"razorback"}
masterNugget_group=${masterNugget_group:-"razorback"}

command=%%PREFIX%%/bin/masterNugget

start_precmd="masterNugget_precmd"
_piddir=/var/run/razorback
pidfile=${_piddir}/masterNugget.pid

masterNugget_precmd()
{
	export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:%%PREFIX%%/bin:%%PREFIX%%/sbin
	install -d -o $masterNugget_user -g $masterNugget_user -m 755 $_piddir
	cd /var/lib/razorback
	export HOME=/var/lib/razorback
}

run_rc_command "$1"