File: preinst

package info (click to toggle)
tripwire 2.3.1.2.0-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,876 kB
  • ctags: 6,896
  • sloc: cpp: 57,709; sh: 1,295; perl: 1,238; yacc: 497; lex: 356; makefile: 269; ansic: 10
file content (44 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download
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 -e

#DEBHELPER#

# 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 -a ! -f $lib/tripwire-1.2 ] \
		&& mv $lib/tripwire $lib/tripwire-1.2
	    [ -f $lib/ztripwire -a ! -f $lib/ztripwire-1.2 ] \
		&& mv $lib/ztripwire $lib/ztripwire-1.2
	    man=/usr/share/man/man8
	    [ -f $man/tripwire.8.gz -a ! -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