1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#!/bin/bash
# Source debconf library.
. /usr/share/debconf/confmodule
if [ "$1" = purge ]
then
[ -r /etc/postgresql/postmaster.conf ] && . /etc/postgresql/postmaster.conf || true
PGDATA="${POSTGRES_DATA:-/var/lib/postgres/data}"
rm -f /var/lib/postgres/automatic_update.log
rm -rf /usr/lib/postgresql/dumpall /var/lib/postgres/dumpall
if [ -d "$PGDATA" ]
then
db_get postgresql/purge_data_too
if [ "$RET" = true ]
then
rm -rf "$PGDATA"
fi
rm -f /var/lib/postgres/.profile /var/lib/postgres/.bash_profile /var/lib/postgres/.login
rmdir /var/lib/postgres ||
echo /var/lib/postgres not empty so not removed. >&2
fi
if [ -x /usr/bin/ucf ]; then
ucf --purge /etc/postgresql/postgresql.conf
ucf --purge /etc/postgresql/postmaster.conf
fi
rm -f /etc/postgresql/postgresql.conf
rm -f /etc/postgresql/postmaster.conf
rm -f /var/log/postgresql/postgres.log*
rmdir /etc/postgresql ||
echo /etc/postgresql not empty so not removed. >&2
fi
#DEBHELPER#
|