X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=debian%2Fpostrm;h=f0f4aae75ede7c5f9a4e2d4e88942bc9eaf3e8c8;hb=92890547320a687838b916e415cd189564aa044f;hp=25f393ad9eb9e7033d35887039bf146182f352f1;hpb=5f9d2a076943cbc4c76ce60348235e329d4e2abe;p=pkg%2Ft-prot.git diff --git a/debian/postrm b/debian/postrm index 25f393a..f0f4aae 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,16 +1,27 @@ -#!/bin/sh -e +#!/bin/sh # postrm for t-prot +# Copyright 2002-2010 by Rhonda D'Vine +# Licenced under WTFPLv2 -# remove /etc/Muttrc.d/t-prot.rc symlink on both remove and purge -if [ "$1" = purge ] || [ "$1" = remove ]; then - if [ -L /etc/Muttrc.d/t-prot.rc ]; then - rm /etc/Muttrc.d/t-prot.rc +set -e + +action=$1 + +case "$action" in + remove) + if [ ! -e /etc/Muttrc.d/t-prot.rc.removed ]; then + # only disable the configuration + mv /etc/Muttrc.d/t-prot.rc /etc/Muttrc.d/t-prot.rc.removed || true fi + ;; + purge) + rm /etc/Muttrc.d/t-prot.rc.removed || true + rm /etc/Muttrc.d/t-prot.rc || true rmdir /etc/Muttrc.d 2> /dev/null || true -fi - -# on purge purge debconf data, too -if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_purge -fi + # remove debconf data on purge + if [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge + fi + ;; +esac