File: aide-common.postrm

package info (click to toggle)
aide 0.19.2-3exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,528 kB
  • sloc: ansic: 12,399; sh: 6,718; lex: 635; makefile: 139; yacc: 138
file content (44 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
#!/bin/sh
#
# post-removal script for AIDE
# A whole lot of this is "borrowed" from tripwire's postinst
#

set -e

if [ -n "$AIDEDEBUG" ]; then
  printf "now debugging %s %s\n" "$0" "$@"
  set -x
fi

PKGNAME="aide"

# Make sure we should be running...
[ "$1" = "purge" ] || exit 0

UCF="ucf"
UCFR="ucfr"

if command -v ucfq >/dev/null; then
  for file in $(ucfq --with-colons "$PKGNAME" | cut --delimiter=: --fields=1); do
    for ext in '' '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist .ucf-new .ucf-old .ucf-dist;  do
      rm -f "${file}${ext}"
    done

    if command -v $UCF >/dev/null; then
      $UCF --purge "${file}"
    fi
    if command -v $UCFR >/dev/null; then
      $UCFR --purge "${PKGNAME}" "${file}"
    fi
  done
else
  printf >&2 "ucf no longer installed, not cleaning up\n"
fi

rm -f /var/lib/aide/aide.db /var/lib/aide/aide.db.new
if [ -d "/run/aide" ]; then
    rmdir --ignore-fail-on-non-empty "/run/aide"
fi

#DEBHELPER#