aboutsummaryrefslogtreecommitdiff
path: root/security/i2pd/files/i2pd.in
blob: af6867cdecc1fc1e80281dc3418fb6368c26c7f3 (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
46
47
48
49
#!/bin/sh
#
# PROVIDE: i2pd
# REQUIRE: DAEMON NETWORKING FILESYSTEMS
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable i2pd:
#
# i2pd_enable:		Set to NO by default.
#			Set it to YES to enable i2pd.
# i2pd_certsdir:	The directory where the default certificaties are stores.
# 			Default: %%CERTSDIR%%
# i2pd_config:		The config file used to run the daemon.
#			Default: %%ETCDIR%%/i2pd.conf
# i2pd_datadir:		The datadir used to run the daemon.
#			Default: %%WRITEDATADIR%%
# i2pd_group:		The group account used to run the daemon.
#			Default: %%GROUP%%
# i2pd_user:		The user account used to run the daemon.
#			Default: %%USER%%
#

. /etc/rc.subr

desc="i2pd startup script"
name="i2pd"
rcvar="i2pd_enable"

load_rc_config ${name}

: ${i2pd_enable="NO"}
: ${i2pd_certsdir="%%CERTSDIR%%"}
: ${i2pd_config="%%ETCDIR%%/i2pd.conf"}
: ${i2pd_datadir="%%WRITEDATADIR%%"}
: ${i2pd_group="%%GROUP%%"}
: ${i2pd_user="%%USER%%"}

required_dirs="${i2pd_datadir}"

command="%%PREFIX%%/bin/${name}"
pidfile=/var/run/i2pd/i2pd.pid

command_args="--certsdir ${i2pd_certsdir} --conf ${i2pd_config} --daemon --datadir ${i2pd_datadir} --service"

extra_commands="reload"
reload_cmd="pkill -2 -F ${pidfile} -x i2pd"

run_rc_command "$1"