This file is indexed.

postinst is in iptraf 3.0.0-8.1build1.

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
#!/bin/sh

set -e

case "$1" in
    configure)
	if [ -e /etc/iptraf.cfg ]
	then
		# old, incompatible, binary config file - I won't miss you :)
		rm -f /etc/iptraf.cfg
	fi

	if [ ! -d /var/lib/iptraf ]; then
		mkdir /var/lib/iptraf
	fi

	if [ -e /var/state/iptraf ]; then
		find /var/state/iptraf -mindepth 1 -maxdepth 1 	\
					-exec mv \{\} /var/lib/iptraf/ \;
		rmdir /var/state/iptraf || true
	fi

	# log files may have sensitive data
	test -d /var/log/iptraf || mkdir /var/log/iptraf
	chmod 0700 /var/log/iptraf

	# renaming old logfile rotator since it is marked as conffile and dpkg won't
	# remove it (reported as Bug#72998 by Josip Rodin <joy@cibalia.gkvk.hr>
	test -e /etc/cron.daily/iptraf && \
		mv /etc/cron.daily/iptraf /etc/cron.daily/iptraf.obsolete

	# filters changed in 3.0, move them away (copied from in src/install.sh)
	WORKDIR=/var/lib/iptraf/
	if [ -z "$2" ] || dpkg --compare-versions "$2" lt 3.0.0-1 ; then
		if [ -f $WORKDIR/tcpfilters.dat ]; then
			mv -f $WORKDIR/tcpfilters.dat $WORKDIR/tcpfilters.dat~
		fi

		if [ -f $WORKDIR/udpfilters.dat ]; then
			mv -f $WORKDIR/udpfilters.dat $WORKDIR/udpfilters.dat~
		fi

		if [ -f $WORKDIR/othipfilters.dat ]; then
			mv -f $WORKDIR/othipfilters.dat $WORKDIR/othipfilters.dat~
		fi

		rm -f $WORKDIR/savedfilters.dat
	fi
	;;

    abort-upgrade|abort-remove|abort-deconfigure)
        ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac


# Automatically added by dh_installmenu
if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
	update-menus
fi
# End automatically added section