X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=debian%2Fpostrm;h=9014b6ff66425e5004ffd6e8318db6a44652c33e;hb=ea8f8b7fc33f2a161b2b9e60cd35b82ab7d703a0;hp=e986d4036c12262aee42bdb3656ef3265fbf431c;hpb=84ab93cfdcac04c7c0511ef70eb6242cb78671a4;p=debian%2Famanda diff --git a/debian/postrm b/debian/postrm index e986d40..9014b6f 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,12 +1,6 @@ #!/bin/sh -e case "$1" in purge) - if [ -d /etc/amanda ]; then - # remove all registered config files - rm -rf `cat /var/lib/dpkg/info/amanda-common.conffiles` - # remove /etc amanda if there are no files left - rmdir /etc/amanda 2> /dev/null || true - fi if [ -d /var/log/amanda ]; then rm -rf /var/log/amanda fi @@ -26,6 +20,18 @@ case "$1" in fi rm -f ~backup/.amandahosts + + if which deluser >/dev/null 2>&1 ; then + for group in disk tape; do + # only call deluser when backup is in $group + if getent group "$group" | + awk -F: '{ print $4 }' | + awk -F, '{ for (i=1; i <= NF; i++ ) print $i }' | + grep '^backup$' > /dev/null; then + deluser backup "$group" || true + fi + done + fi ;; remove|upgrade|deconfigure) ;;