| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | # TODO(jelmer): Should this perhaps run as its own user rather than as prometheus? |
| 6 | |
| 7 | case "$1" in |
| 8 | configure) |
| 9 | # Add prometheus user |
| 10 | if ! getentscip-shell system . . getent. passwd prometheus > /dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 11 | adduserscip-shell system . . adduser. --quiet --system --home /var/lib/prometheusscip-shell filesystem . . `/var/lib/prometheus`. --no-create-home \ |
| 12 | --group --gecos "Prometheus daemon" prometheus || truescip-shell system . . true. |
| 13 | fi |
| 14 | chownscip-shell system . . chown. prometheus:prometheus /var/lib/prometheusscip-shell filesystem . . `/var/lib/prometheus`. || truescip-shell system . . true. |
| 15 | |
| 16 | ;; |
| 17 | |
| 18 | abort-upgrade|abort-remove|abort-deconfigure) |
| 19 | : |
| 20 | ;; |
| 21 | |
| 22 | *) |
| 23 | echoscip-shell system . . echo. "postinst called with unknown argument \`$1'" >&2 |
| 24 | exit 1 |
| 25 | ;; |
| 26 | esac |
| 27 | |
| 28 | # dh_installdeb will replace this with shell code automatically |
| 29 | # generated by other debhelper scripts. |
| 30 | |
| 31 | #DEBHELPER# |
| 32 | |
| 33 | exit 0 |