aboutsummaryrefslogtreecommitdiff
path: root/security/honeytrap/files/honeytrap.in
blob: 7c4e383026e740d13eb58f0efb1fed194cca70fb (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
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: honeytrap
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# honeytrap_enable (bool):	Set to NO by default.
#				Set it to YES to enable honeytrap.
# honeytrap_datadir (path):	Set to %%PREFIX%%/var/lib/honeytrap
#				by default.
# honeytrap_config (path):	Set to %%PREFIX%%/etc/honeytrap.toml
#				by default.

. /etc/rc.subr

name=honeytrap
rcvar=honeytrap_enable

load_rc_config $name

: ${honeytrap_enable:="NO"}
: ${honeytrap_datadir="%%PREFIX%%/var/lib/honeytrap"}
: ${honeytrap_config="%%PREFIX%%/etc/honeytrap.toml"}

start_cmd="$name_start"

honeytrap_program="%%PREFIX%%/bin/honeytrap"
honeytrap_flags="--data $honeytrap_datadir --config $honeytrap_config"
pidfile=/var/run/${name}.pid

honeytrap_start()
{
	daemon -p $pidfile -u $name $honeytrap_program $honeytrap_flags
}

run_rc_command "$1"