diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:36:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:36:05 +0000 |
commit | 8bc37fc67193505a5a346fd2f1bee70476eb3942 (patch) | |
tree | 24bc012bd3fa1f2e7cb96ac12c041bafe31b0670 /debian/postinst | |
parent | Adding upstream version 1.1.0. (diff) | |
download | icingadb-8bc37fc67193505a5a346fd2f1bee70476eb3942.tar.xz icingadb-8bc37fc67193505a5a346fd2f1bee70476eb3942.zip |
Adding debian version 1.1.0-1.debian/1.1.0-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/postinst | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..6ab3d87 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,41 @@ +#!/bin/sh +set -e + +setperm() { + user="$1" + group="$2" + mode="$3" + file="$4" + shift 4 + # only do something when no setting exists + if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then + chown "$user":"$group" "$file" + chmod "$mode" "$file" + fi +} + +case "$1" in + configure) + + if ! getent passwd icingadb > /dev/null ; then + echo 'Adding system-user for icingadb' 1>&2 + adduser --system --group --home /etc/icingadb \ + --disabled-login --force-badname icingadb > /dev/null + fi + + setperm icingadb icingadb 0750 /etc/icingadb + setperm icingadb icingadb 0640 /etc/icingadb/config.yml + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 |