File: postinst

package info (click to toggle)
iptraf 2.1.1-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,112 kB
  • ctags: 950
  • sloc: ansic: 9,494; makefile: 111; sh: 50
file content (60 lines) | stat: -rw-r--r-- 1,390 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh

set -e

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

if command -v install-docs >/dev/null 2>&1; then
	install-docs -i /usr/share/doc-base/iptraf
fi

#if echo $2 | grep -q "1\.[0123]\.0"
#then
#	echo -n "Converting old configuration files to newer format..."
#	if echo $2 | grep -q "1\.[01]\.0"
#	then
#		/usr/lib/iptraf/cfconv-1.1_to_1.2
#	fi
#	if echo $2 | grep -q "1\.2\.0"
#	then
#		/usr/lib/iptraf/cfconv-1.2_to_1.3
#	fi
#	if echo $2 | grep -q "1\.3\.0"
#	then
#		/usr/lib/iptraf/cfconv-1.3_to_1.4
#	fi
#	echo "done."
#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

if [   -e /etc/ethers -a \
     ! -e /var/lib/iptraf/ethernet.desc -a \
     ! -e /var/state/iptraf/ethernet.desc ]
then
	echo -n "Using /etc/ethers (from tcpdump) to create /var/lib/iptraf..."
	cat /etc/ethers | expand | tr -d ':' | sed -e 's/ /:/' | tr -d ' ' > \
			/var/lib/iptraf/ethernet.desc
	echo "done."
fi

# Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then
	if [ -d /usr/doc -a ! -e /usr/doc/iptraf -a -d /usr/share/doc/iptraf ]; then
		ln -sf ../share/doc/iptraf /usr/doc/iptraf
	fi
fi
# End automatically added section