package-pipelines-miscellan.../prometheus2influxdb/debian.postinst

23 lines
584 B
Text
Raw Normal View History

2023-12-05 23:40:22 +01:00
#!/bin/bash
set -e
if [[ "$1" == "configure" ]]; then
if ! getent group prometheus2influxdb >/dev/null; then
groupadd --system prometheus2influxdb
fi
if ! getent passwd prometheus2influxdb >/dev/null; then
useradd --system --gid prometheus2influxdb --home-dir /nonexistent --shell /sbin/nologin prometheus2influxdb
fi
chown root:prometheus2influxdb /etc/prometheus2influxdb.yaml
chmod 0640 /etc/prometheus2influxdb.yaml
deb-systemd-helper enable prometheus2influxdb.timer
deb-systemd-invoke restart prometheus2influxdb.timer
fi