X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=debian%2Fpostinst;h=f79ccb1624a0c6da94898841203218475fb48fd0;hb=451adf5e77554240efa778fc2e52e5d5b52c2059;hp=f55b3c8ddd14f1e7a5e1208b1193c9d642643d61;hpb=ea4c4776a6816a05cdad45bd9b6b65a5641c703a;p=privoxy.git diff --git a/debian/postinst b/debian/postinst index f55b3c8d..f79ccb16 100644 --- a/debian/postinst +++ b/debian/postinst @@ -25,6 +25,9 @@ set -e CONFDIR=/etc/privoxy CONFIG=$CONFDIR/config +EXAMPLE_CONFIG=/usr/share/privoxy/config + +. /usr/share/debconf/confmodule case "$1" in configure) @@ -36,6 +39,28 @@ case "$1" in [ -f $CONFDIR/match-all.action ] \ && chown privoxy $CONFDIR/match-all.action + db_get privoxy/listen-address || true + perl -le ' + $done = 0; + while () { + chomp; + if ($_ =~ m/^\s*listen-address\s+.*/) { + if (!$done) { + foreach (@ARGV) { + print "listen-address $_"; + } + } + $done = 1; + } else { + print; + } + }' \ + $RET \ + < $EXAMPLE_CONFIG > $CONFIG.ucftmp + ucf --three-way --debconf-ok $CONFIG.ucftmp $CONFIG + ucfr privoxy $CONFIG + rm -f $CONFIG.ucftmp + if [ "x$2" != "x" ] && dpkg --compare-versions "$2" lt "3.0.4" then # Upgrading from a 3.0.3* version