summaryrefslogtreecommitdiffstats
path: root/debian/knot.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:36:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:36:23 +0000
commit3050ea58ec5f7f1d5a3d70a080a9cb9dceadda38 (patch)
treeb57c014754c37f359e87a796a2bc2859572b6612 /debian/knot.postinst
parentAdding upstream version 3.0.5. (diff)
downloadknot-1970a691b12302d2778d8d90dc22b53dbdc8c383.tar.xz
knot-1970a691b12302d2778d8d90dc22b53dbdc8c383.zip
Adding debian version 3.0.5-1+deb11u1.debian/3.0.5-1+deb11u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/knot.postinst')
-rw-r--r--debian/knot.postinst26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/knot.postinst b/debian/knot.postinst
new file mode 100644
index 0000000..7a69d85
--- /dev/null
+++ b/debian/knot.postinst
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "configure" ]; then
+ if ! getent passwd knot > /dev/null; then
+ adduser --quiet --system --group --no-create-home --home /var/lib/knot knot
+ fi
+
+ dpkg-statoverride --list /var/lib/knot > /dev/null || dpkg-statoverride --update --add knot knot 0755 /var/lib/knot
+ dpkg-statoverride --list /etc/knot/knot.conf > /dev/null || dpkg-statoverride --update --add knot knot 0640 /etc/knot/knot.conf
+ dpkg-statoverride --list /etc/knot > /dev/null || dpkg-statoverride --update --add knot knot 0750 /etc/knot
+fi
+
+if [ "$1" = "configure" ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt "2.5.0-1~"; then
+ KNOT_USER=$(/usr/lib/knot/get_user 2>/dev/null || echo "knot")
+
+ /usr/lib/knot/get_kaspdb | while read KASPDB; do
+ if [ ! -f "${KASPDB}/data.mdb" ]; then
+ runuser -u "${KNOT_USER}" -- /usr/lib/knot/kasp_json2lmdb -i "${KASPDB}"
+ fi
+ done
+fi
+
+#DEBHELPER#
+
+exit 0