aboutsummaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-08-05 14:43:14 +0200
committerGuido Günther <agx@sigxcpu.org>2014-08-05 14:43:14 +0200
commit95620b53bcdf68843cd210306bb7228bfee3239c (patch)
tree71e1578814515cdc67cfd9fff230d98d4b5fd99f /debian/postinst
parenta0aa1dd751453a3557f16912cc5cfe1225eb3253 (diff)
parent20df31b862f3fbb274a4bb4952a84a53b73238a0 (diff)
Merge tag 'debian/0.0.8-2' into bpo/wheezy
whatmaps Debian release 0.0.8-2
Diffstat (limited to 'debian/postinst')
-rw-r--r--debian/postinst47
1 files changed, 47 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..9965480
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -e
+
+APT_CONF=/etc/apt/apt.conf.d/20services
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+case "$1" in
+ configure)
+ db_get whatmaps/enable_service_restarts || true
+ DBVAL="$RET"
+
+ # Configuration file doesn't exist but user wants updates enabled so
+ # recreate it:
+ if [ ! -f $APT_CONF ] && [ $DBVAL = "true" ]; then
+ cat << EOF > $APT_CONF
+// Set to 1 or true to enable service restarts on security updates
+Whatmaps::Enable-Restart "1";
+
+// What updates are considered security updates
+Whatmaps::Security-Update-Origins {
+ "\${distro_id} stable";
+ "\${distro_id} \${distro_codename}-security";
+};
+EOF
+ else
+ case $DBVAL in
+ "true") VAL=1;;
+ *) VAL=0;;
+ esac
+ sed -ie "s,^\(\s*Whatmaps::Enable-Restart\s\+\"\)\S\+\(\"\s*;\),\1${VAL}\2," $APT_CONF
+ fi
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0