File: postrm

package info (click to toggle)
postgresql 7.4.7-6sarge6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,168 kB
  • ctags: 27
  • sloc: sh: 1,903; makefile: 337; ansic: 204; perl: 69; sed: 6; tcl: 1
file content (38 lines) | stat: -rw-r--r-- 1,017 bytes parent folder | download
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#