#!/bin/sh

# Add $ARGS for more arguments to node_exporter
[ -f ./conf ] && . ./conf

: ${USER:=_node_exporter}
: ${RUNIT_COLLECTOR:='--collector.runit --collector.runit.servicedir /var/service'}
[ -n "$LISTEN_ADDR" ] && LISTEN_ADDR="--web.listen-address ${LISTEN_ADDR}"

exec chpst -u $USER node_exporter ${RUNIT_COLLECTOR} ${LISTEN_ADDR} ${ARGS}
