#!/bin/sh set -e pathfind() { OLDIFS="$IFS" IFS=: for p in $PATH; do if [ -x "$p/$*" ]; then IFS="$OLDIFS" return 0 fi done IFS="$OLDIFS" return 1 } apache_remove() { if [ diff /etc/taler-merchant/apache.conf /etc/apache2/conf-available/taler-merchant.conf >/dev/null 2>&1 ]; then rm -f /etc/apache2/conf-available/taler-merchant.conf fi } nginx_remove() { if [ diff /etc/taler-exchange/nginx.conf /etc/apache2/conf-available/taler-exchange.conf >/dev/null 2>&1 ]; then rm -f /etc/nginx/conf-available/taler-merchant.conf fi } if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then . /usr/share/dbconfig-common/dpkg/postrm.pgsql dbc_go taler-merchant "$@" fi if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_version 2.0 db_get taler-merchant/reconfigure-webserver webservers="$RET" for webserver in $webservers; do webserver=${webserver%,} if [ "$webserver" = "nginx" ] ; then nginx_remove else apache_remove fi done fi fi case "${1}" in purge) if [ -e /usr/share/debconf/confmodule ] then . /usr/share/debconf/confmodule db_version 2.0 db_get taler-merchant/username _USERNAME="${RET:-taler-merchant-httpd}" db_get taler-merchant/groupname _GROUPNAME="${RET:-taler-merchant-httpd}" else _USERNAME="taler-merchant-httpd" _GROUPNAME="taler-merchant-httpd" fi if pathfind deluser then deluser --quiet --system ${_USERNAME} || true fi if pathfind delgroup then delgroup --quiet --system --only-if-empty ${_GROUPNAME} || true fi ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`${1}'" >&2 exit 1 ;; esac #DEBHELPER# exit 0