#!/bin/sh # postrm script for drm-admin # # see: dh_installdeb(1) set -e # source debhelper-library . /usr/share/debconf/confmodule # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package PKGNAME=deegree-owsproxy case "$1" in remove) # do nothing echo "removing..." ;; purge) # remove the the database only when purging db_get ${PKGNAME}/dbhost && dbhost=$RET if [ "${dbhost}" == "localhost" ] ; then db_get ${PKGNAME}/dbname && dbname=$RET db_get ${PKGNAME}/dbuser && dbuser=$RET su postgres -c "dropdb $dbname" su postgres -c "dropuser $dbuser" fi ;; upgrade) # do nothing echo "upgrading..." exit 0 ;; abort-upgrade|failed-upgrade|abort-install|disappear) #implement me exit 0 ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installdebconf if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_purge fi # End automatically added section exit 0