aboutsummaryrefslogtreecommitdiffstats
path: root/devel/athens/files/athens.in
blob: f9857d8fd2ef3aaf0c4be0f6d9996c25a65f34a1 (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
#!/bin/sh
#
# PROVIDE: athens
# REQUIRE: LOGIN networking
# KEYWORD: shutdown
#
# athens_enable (bool):
#   Default value: "NO"
#   Flag that determines whether athens is enabled
#
# athens_config (string)
#   Default value %%ETCDIR%%/athens.toml
#   Path to the athens configuration file
#
# athens_user (string)
#   This is the user that athens runs as
#   Set to %%ATHENS_USER%% by default
#
# athens_group (string)
#   This is the group that athens runs as
#   Set to %%ATHENS_GROUP%% by default

. /etc/rc.subr

name=athens
rcvar=athens_enable

: ${athens_enable:="NO"}
: ${athens_config:="%%ETCDIR%%/athens.toml"}
: ${athens_user:=%%ATHENS_USER%%}
: ${athens_group:=%%ATHENS_GROUP%%}
: ${athens_pidfile:="/var/run/athens.pid"}

athens_command="%%PREFIX%%/bin/athens -config_file ${athens_config}"
command="/usr/sbin/daemon"
command_args="-p ${athens_pidfile} -u ${athens_user} -S ${athens_command}"

PATH="${PATH}:%%PREFIX%%/bin"

load_rc_config $name

required_files="${athens_config}"

run_rc_command "$1"