2022-11-07 19:05:15 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# PROVIDE: ipmi_exporter
|
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
|
|
# to enable this service:
|
|
|
|
#
|
|
|
|
# ipmi_exporter_enable (bool): Set to YES to enable the IPMI exporter.
|
|
|
|
# Default: NO
|
|
|
|
# ipmi_exporter_config (str): Set to the path of configuration file.
|
|
|
|
# Default: ""
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=ipmi_exporter
|
|
|
|
rcvar=${name}_enable
|
|
|
|
load_rc_config $name
|
|
|
|
|
2023-03-03 09:46:21 +01:00
|
|
|
: ${ipmi_exporter_enable:="NO"}
|
|
|
|
: ${ipmi_exporter_config:=""}
|
2022-11-07 19:05:15 +01:00
|
|
|
|
|
|
|
pidfile="/var/run/${name}.pid"
|
|
|
|
command="/usr/sbin/daemon"
|
|
|
|
procname="%%PREFIX%%/bin/${name}"
|
2023-03-03 09:46:21 +01:00
|
|
|
command_args="-S -p ${pidfile} ${procname} --config.file=\"${ipmi_exporter_config}\""
|
2022-11-07 19:05:15 +01:00
|
|
|
start_precmd="${name}_precmd"
|
|
|
|
|
|
|
|
ipmi_exporter_precmd()
|
|
|
|
{
|
|
|
|
export PATH=${PATH}:/usr/local/sbin
|
|
|
|
}
|
|
|
|
|
|
|
|
run_rc_command "$1"
|