postinst is in aide-common 0.16~a2.git20130520-3.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #!/bin/sh
#
# post-installation script for AIDE
# A whole lot of this is "borrowed" from tripwire's postinst
#
set -e
# We need debconf.
. /usr/share/debconf/confmodule
if [ -n "$AIDEDEBUG" ]; then
echo "now debugging $0 $@"
set -x
fi
PKGNAME="aide"
# Flags to be passed to aideinit
aideinitflags="-b"
# Make sure we should be running...
case "$1" in
configure)
# continue below
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;
*)
echo "postinst called with unknown argument "$1 >&2
exit 0
;;
esac
SRCDIR="/usr/share/$PKGNAME/config"
TRGDIR="/etc"
UCF="ucf --debconf-ok --three-way"
UCFR="ucfr"
(cd "$SRCDIR" && find -type d -print0 ) | \
(cd "$TRGDIR"&& xargs -0 mkdir -p --)
for file in $(find $SRCDIR -type f -printf '%P\n' ); do
OLDSUM=""
if [ -f "$TRGDIR/$file" ]; then
OLDSUM="$(md5sum "$TRGDIR/$file")"
fi
$UCF "$SRCDIR/$file" "$TRGDIR/$file"
$UCFR "$PKGNAME" "$TRGDIR/$file"
if cmp --quiet "$SRCDIR/$file" "$TRGDIR/$file" && \
[ "$OLDSUM" != "$(md5sum "$TRGDIR/$file")" ]; then
# "$TRGDIR/$file" has changed while ucf was running and it changed
# to the file that was shipped with the package. We (hopefully safely)
# assume that this means that the user decided to accept the new
# version, and we're now copying over the file mode as well.
# This is a workaround for ucf issue #406476.
chmod --reference="$SRCDIR/$file" "$TRGDIR/$file"
fi
done
db_get aide/aideinit
if [ "$RET" = "true" ]; then
if [ -f "/var/lib/aide/aide.db.new" ]; then
db_get aideinit/overwritenew
if [ "$RET" = "true" ]; then
aideinitflags="$aideinitflags -y"
fi
fi
db_get aideinit/copynew
if [ "$RET" = "true" ]; then
aideinitflags="$aideinitflags -f"
fi
# generate configuration
update-aide.conf
# borrowed this trick from man-db
# just making sure it actually ends up in the background...
start-stop-daemon --start --background --pidfile /dev/null \
--startas /usr/sbin/aideinit -- $aideinitflags
db_set aide/aideinit false
fi
exit 0
|