Code

fix web package
[pkg-check_mk.git] / debian / check-mk-web.postinst
diff --git a/debian/check-mk-web.postinst b/debian/check-mk-web.postinst
new file mode 100644 (file)
index 0000000..a1aa1b3
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+setperm() {
+    local user="$1"
+    local group="$2"
+    local mode="$3"
+    local 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)
+        # explicitly set permissions on some files
+        setperm www-data www-data 770 /var/lib/check_mk/web
+    ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+    *)
+        echo "postinst called with unknown argument \$1'" >&2
+        exit 1
+    ;;
+esac
+