#!/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" if [ -f $APT_CONF ]; then case $DBVAL in "true") VAL=1;; *) VAL=0;; esac sed -i -e "s,^\(\s*Whatmaps::Enable-Restart\s\+\"\)\S\+\(\"\s*;\),\1${VAL}\2," $APT_CONF else # Configuration file doesn't exist but user wants updates enabled so # recreate it: if [ $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 fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # Automatically added by dh_python3 if command -v py3compile >/dev/null 2>&1; then py3compile -p whatmaps fi if command -v pypy3compile >/dev/null 2>&1; then pypy3compile -p whatmaps || true fi # End automatically added section exit 0