summaryrefslogtreecommitdiffstats
path: root/packaging/cmake/pkg-files/deb/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/cmake/pkg-files/deb/dashboard')
-rwxr-xr-xpackaging/cmake/pkg-files/deb/dashboard/postinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/dashboard/postrm17
-rwxr-xr-xpackaging/cmake/pkg-files/deb/dashboard/preinst11
3 files changed, 39 insertions, 0 deletions
diff --git a/packaging/cmake/pkg-files/deb/dashboard/postinst b/packaging/cmake/pkg-files/deb/dashboard/postinst
new file mode 100755
index 000000000..320a649d9
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/dashboard/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ if ! dpkg-statoverride --list /usr/share/netdata/www > /dev/null 2>&1; then
+ dpkg-statoverride --update --add root netdata 0755 /usr/share/netdata/www
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/dashboard/postrm b/packaging/cmake/pkg-files/deb/dashboard/postrm
new file mode 100755
index 000000000..85438ad12
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/dashboard/postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ remove) ;;
+
+ purge)
+ if dpkg-statoverride --list | grep -qw /var/lib/netdata/www; then
+ dpkg-statoverride --remove /var/lib/netdata/www
+ fi
+
+ if dpkg-statoverride --list | grep -qw /usr/share/netdata/www; then
+ dpkg-statoverride --remove /usr/share/netdata/www
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/dashboard/preinst b/packaging/cmake/pkg-files/deb/dashboard/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/dashboard/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac