summaryrefslogtreecommitdiffstats
path: root/debian/netdata.postinst.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-12-31 18:13:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-01 13:12:25 +0000
commitf110fc61334a2d6a13a87f782a84c4c79ff7ccb2 (patch)
treec6dbef86716ba14b5f7d58e70791b67968124047 /debian/netdata.postinst.in
parentReleasing debian version 1.11.1+dfsg-2. (diff)
downloadnetdata-f110fc61334a2d6a13a87f782a84c4c79ff7ccb2.tar.xz
netdata-f110fc61334a2d6a13a87f782a84c4c79ff7ccb2.zip
Readding debconf-handling of health_alarm_notify.conf (Reopens: #904459).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/netdata.postinst.in')
-rw-r--r--debian/netdata.postinst.in26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/netdata.postinst.in b/debian/netdata.postinst.in
index d4fe0171c..49ed64955 100644
--- a/debian/netdata.postinst.in
+++ b/debian/netdata.postinst.in
@@ -2,8 +2,34 @@
set -e
+CONFFILE="/etc/netdata/health_alarm_notify.conf"
+
+. /usr/share/debconf/confmodule
+
case "$1" in
configure)
+ db_get netdata/send_email
+ SEND_EMAIL="${RET:-true}" # boolean
+
+ db_stop
+
+ case "${SEND_EMAIL}" in
+ true)
+ SEND_EMAIL="YES"
+ ;;
+
+ *)
+ SEND_EMAIL="NO"
+ ;;
+ esac
+
+ if [ -e "${CONFFILE}" ]; then
+ sed -e "s|^ *SEND_EMAIL=.*|SEND_EMAIL=\"${SEND_EMAIL}\"|" \
+ < "${CONFFILE}" > "${CONFFILE}.tmp"
+
+ mv -f "${CONFFILE}.tmp" "${CONFFILE}"
+ fi
+
if [ -z "$2" ]; then
if ! getent group netdata >/dev/null; then
addgroup --quiet --system netdata