set -x
fi
-PKGNAME="pdns-backend-gmysql"
+PKGNAME="pdns-backend-mysql"
# rename ucf-conffile. This was mostly stolen from cacti.postinst after
# a short discussion on debian-mentors, see
}
if [ "$1" = "configure" ]; then
+ if ucfq -w /etc/powerdns/pdns.d/pdns.local.gmysql.conf | grep 'pdns-backend-gmysql' >/dev/null; then
+ # before 4.0.0~beta1 (Debian), 4.1.2... (powerdns.com), PKGNAME was incorrectly set to pdns-backend-gmysql. Fix that.
+ ucfr --purge 'pdns-backend-gmysql' '/etc/powerdns/pdns.d/pdns.local.gmysql.conf'
+ fi
if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.3; then
renameconffile /etc/powerdns/pdns.d/pdns.local.gmysql /etc/powerdns/pdns.d/pdns.local.gmysql.conf /dev/null
fi
# Remove configuration file
if [ "$1" = "purge" ]; then
# Remove files registered with ucf.
- # this has been pulled from aide-common.postrm
-
- UCF="ucf"
- UCFR="ucfr"
-
if command -v ucfq >/dev/null; then
for file in $(ucfq --with-colons "$PKGNAME" | cut --delimiter=: --fields=1); do
- for ext in '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist; do
- rm -f ${file}$ext
- done
rm -f ${file}
-
- if command -v $UCF >/dev/null; then
- $UCF --purge ${file}
- fi
- if command -v $UCFR >/dev/null; then
- $UCFR --purge $PKGNAME ${file}
- fi
+ ucf --purge ${file}
+ ucfr --purge $PKGNAME ${file}
done
else
echo >&2 "ucf no longer installed, not cleaning up"