preinst is in tripwire 2.4.3.1-2.
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 | #!/bin/sh
set -e
# Make sure we should be running...
case "$1$2" in
upgrade*)
if dpkg --compare-versions $2 lt 2.3.0
then
# Source debconf library.
. /usr/share/debconf/confmodule
db_get tripwire/upgrade
case "$RET" in
false)
exit 1;
;;
*)
etc=/etc/tripwire
if [ -f $etc/tw.config ]; then
mv $etc/tw.config $etc/tw.config-1.2
rm -f /etc/tw.config
else
[ -f /etc/tw.config ] && mv /etc/tw.config $etc/tw.config-1.2
fi
lib=/usr/lib/tripwire
[ -f $lib/tripwire ] && [ ! -f $lib/tripwire-1.2 ] \
&& mv $lib/tripwire $lib/tripwire-1.2
[ -f $lib/ztripwire ] && [ ! -f $lib/ztripwire-1.2 ] \
&& mv $lib/ztripwire $lib/ztripwire-1.2
man=/usr/share/man/man8
[ -f $man/tripwire.8.gz ] && [ ! -f $man/tripwire-1.2.8.gz ] \
&& mv $man/tripwire.8.gz $man/tripwire-1.2.8.gz
cron=/etc/cron.daily/tripwire
sed -e "s!$lib/z*tripwire!&-1.2 -c $etc/tw.config-1.2!" < $cron > $cron-1.2
rm $cron
;;
esac
fi
;;
esac
|