Fix unbound_exportre_host usage

This commit is contained in:
yo 2020-09-26 15:48:48 +02:00
parent e9d306b88e
commit f254cc649f

View File

@ -18,7 +18,7 @@
# unbound_exporter_log_file (string): Set file that unbound_exporter will log to # unbound_exporter_log_file (string): Set file that unbound_exporter will log to
# Default is "/var/log/unbound_exporter.log" # Default is "/var/log/unbound_exporter.log"
# unbound_exporter_host (string): Set unbound socket path # unbound_exporter_host (string): Set unbound socket path
# Default is /var/run/local_unbound.ctl # Default is unix:/var/run/local_unbound.ctl
# unbound_exporter_ca (string): Set unbound ca filename # unbound_exporter_ca (string): Set unbound ca filename
# Default is "" (use socket) # Default is "" (use socket)
# unbound_exporter_cert (string): Set unbound control cert filename # unbound_exporter_cert (string): Set unbound control cert filename
@ -41,7 +41,10 @@ load_rc_config $name
: ${unbound_exporter_user:=unbound} : ${unbound_exporter_user:=unbound}
: ${unbound_exporter_group:=unbound} : ${unbound_exporter_group:=unbound}
: ${unbound_exporter_log_file=/var/log/unbound_exporter.log} : ${unbound_exporter_log_file=/var/log/unbound_exporter.log}
: ${unbound_exporter_host=/var/run/local_unbound.ctl} : ${unbound_exporter_host=unix:/var/run/local_unbound.ctl}
: ${unbound_exporter_ca=""}
: ${unbound_exporter_cert=""}
: ${unbound_exporter_key=""}
: ${unbound_exporter_bind=:9167} : ${unbound_exporter_bind=:9167}
pidfile=/var/run/unbound_exporter.pid pidfile=/var/run/unbound_exporter.pid
@ -49,19 +52,14 @@ command=/usr/sbin/daemon
procname="%%PREFIX%%/bin/unbound_exporter" procname="%%PREFIX%%/bin/unbound_exporter"
if [ -n "${unbound_exporter_cert}" ]; then if [ -n "${unbound_exporter_cert}" ]; then
command_args="-p ${pidfile} /usr/bin/env ${procname} \ command_args="-p ${pidfile} /usr/bin/env ${procname} -unbound.host ${unbound_exporter_host} \
-unbound.ca ${unbound_exporter_ca} \ -unbound.ca ${unbound_exporter_ca} -unbound.cert ${unbound_exporter_cert} -unbound.key ${unbound_exporter_key} \
-unbound.cert ${unbound_exporter_cert} \ -web.listen-address ${unbound_exporter_bind} ${unbound_exporter_args} > ${unbound_exporter_log_file} 2>&1"
-unbound.key ${unbound_exporter_key} \
-web.listen-address ${unbound_exporter_bind} \
${unbound_exporter_args} > ${unbound_exporter_log_file} 2>&1"
else else
command_args="-p ${pidfile} /usr/bin/env ${procname} \ command_args="-p ${pidfile} /usr/bin/env ${procname} -unbound.host ${unbound_exporter_host} \
-unbound.host ${unbound_exporter_host} \ -web.listen-address ${unbound_exporter_bind} ${unbound_exporter_args} > ${unbound_exporter_log_file} 2>&1"
-web.listen-address ${unbound_exporter_bind} \
${unbound_exporter_args} > ${unbound_exporter_log_file} 2>&1"
fi fi
start_precmd=unbound_exporter_startprecmd start_precmd=unbound_exporter_startprecmd
unbound_exporter_startprecmd() unbound_exporter_startprecmd()