24 lines
641 B
Text
24 lines
641 B
Text
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [[ "$1" == "configure" ]]; then
|
||
|
|
||
|
if ! getent group prometheus >/dev/null; then
|
||
|
groupadd --system prometheus
|
||
|
fi
|
||
|
|
||
|
if ! getent passwd prometheus >/dev/null; then
|
||
|
useradd --system --gid prometheus --home-dir /var/lib/prometheus --shell /usr/sbin/nologin prometheus
|
||
|
fi
|
||
|
|
||
|
chown root:prometheus /etc/prometheus/ipmi-exporter /etc/prometheus/ipmi-exporter/config.yaml
|
||
|
chmod g+rx /etc/prometheus/ipmi-exporter
|
||
|
chmod g+r /etc/prometheus/ipmi-exporter
|
||
|
|
||
|
deb-systemd-helper enable prometheus-ipmi-exporter.service
|
||
|
deb-systemd-invoke restart prometheus-ipmi-exporter.service
|
||
|
|
||
|
fi
|
||
|
|