aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/xmrig/files/xmrig.in
blob: 447b40a604a0821bff8f582df8e65023c9295b69 (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
#!/bin/sh

# PROVIDE: xmrig
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# xmrig_enable (bool):	Set to NO by default.
#			Set it to YES to enable it.
# xmrig_user:		The user account the XMRig daemon runs as.
#			It uses '%%USERS%%' user by default.
#			Do not sets it as empty or it will run as root.
# xmrig_conf:		The configuration file XMRig uses.    
#			Default: %%ETCDIR%%/config.json
# xmrig_flags:		Additional runtime flags.

. /etc/rc.subr
name="%%PORTNAME%%"
rcvar="${name}_enable"
load_rc_config ${name}

: ${xmrig_enable:="NO"}
: ${xmrig_user:="%%USERS%%"}
: ${xmrig_conf:="%%ETCDIR%%/config.json"}
: ${xmrig_flags:=""}

command="/usr/sbin/daemon"
procname="%%PREFIX%%/bin/xmrig"
command_args="-f ${procname} --config=${xmrig_conf} ${xmrig_flags}"

run_rc_command "$1"