File: murano-common.postrm

package info (click to toggle)
murano 1%3A3.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,320 kB
  • ctags: 4,297
  • sloc: python: 30,335; sh: 705; makefile: 79; ruby: 16
file content (35 lines) | stat: -rw-r--r-- 975 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
#!/bin/sh

set -e

PROJECT_NAME=murano
PROJECT_CONF=/etc/${PROJECT_NAME}/${PROJECT_NAME}.conf
PROJECT_PKG=${PROJECT_NAME}-common

if [ "$1" = "purge" ] && [ -f /usr/share/debconf/confmodule ] ; then
	if [ -f /usr/share/debconf/confmodule ] ; then
		. /usr/share/debconf/confmodule

		db_get ${PROJECT_NAME}/configure_db || true
		if [ "$RET" = "true" ]; then
			if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
				. /usr/share/dbconfig-common/dpkg/postrm
				dbc_go ${PROJECT_PKG} $@
			else
				rm -f /etc/dbconfig-common/${PROJECT_PKG}.conf
				if which ucf >/dev/null 2>&1; then
					ucf --purge /etc/dbconfig-common/${PROJECT_PKG}.conf
					ucfr --purge ${PROJECT_PKG} /etc/dbconfig-common/${PROJECT_PKG}.conf
				fi
			fi
		fi
	fi
	rm -f ${PROJECT_CONF}
	rmdir --ignore-fail-on-non-empty /etc/${PROJECT_NAME} || true
	rm -rf /var/lib/${PROJECT_NAME} /var/log/${PROJECT_NAME} /var/cache/${PROJECT_NAME}
	rm -f /etc/murano/murano-cfapi.conf
fi

#DEBHELPER#

exit 0