This file is indexed.

preinst is in sanewall 1.0.2+ds-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
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
#!/bin/sh
set -e
if [ -d /etc/firehol -a ! -d /etc/sanewall ]; then
	echo
	echo
	echo "Copying the existing FireHOL configuration folder into a Sanewall one."
	cp -prd /etc/firehol /etc/sanewall
	if [ -f /etc/sanewall/firehol.conf ]; then
		echo "Roughly adapting the existing FireHOL configuration file into a Sanewall one."
		cat > /etc/sanewall/sanewall.conf <<-EOF
			# Sanewall configuration file

			# See sanewall.conf(5) manual page and Sanewall Manual for details.
			#
			# This configuration file was roughly adapted from the then existing
			# FireHOL one; it might be revisited by hand.
			#

			# Instate default FireHOL behaviour (defaults changed in Sanewall)
			SANEWALL_INPUT_ACTIVATION_POLICY="ACCEPT"
			SANEWALL_OUTPUT_ACTIVATION_POLICY="ACCEPT"
			SANEWALL_FORWARD_ACTIVATION_POLICY="ACCEPT"
			SANEWALL_ESTABLISHED_ACTIVATION_ACCEPT="0"

EOF
		sed -e 's/FIREHOL/SANEWALL/g' -e 's@FireHOL@Sanewall@g' /etc/sanewall/firehol.conf >> /etc/sanewall/sanewall.conf
		chown --reference /etc/sanewall/firehol.conf /etc/sanewall/sanewall.conf
		chmod --reference /etc/sanewall/firehol.conf /etc/sanewall/sanewall.conf
		rm -rf /etc/sanewall/firehol.conf
	fi
	echo
fi
if [ -f /etc/default/firehol -a ! -f /etc/default/sanewall ]; then
	echo
	echo
	echo "Roughly adapting the existing FireHOL application default file into a Sanewall one."
	cat > /etc/default/sanewall <<-EOF
		# Sanewall application default file
		# sourced by the initscript (/etc/init.d/sanewall).

		# See sanewall-variables(5) manual page or Sanewall Manual
		# for the full list of variables that control the behaviour of Sanewall
		# and their respective description.
		#
		# This application default file was roughly adapted from the then existing
		# FireHOL one; it might be revisited by hand.
		#

EOF
	sed -e "s/FIREHOL/SANEWALL/g" -e 's@FireHOL@Sanewall@g' /etc/default/firehol >> /etc/default/sanewall
	chown --reference /etc/default/firehol /etc/default/sanewall
	chmod --reference /etc/default/firehol /etc/default/sanewall
	echo
fi
if [ -f /etc/sanewall/RESERVED_IPS ]; then
	mv -f /etc/sanewall/RESERVED_IPS /etc/sanewall/RESERVED_IPS.dpkg-bak
	echo
	echo
	echo "Sanewall does not require the IANA Reserved IPS data file RESERVED_IPS."
	echo "The existing RESERVED_IPS has been saved as RESERVED_IPS.dpkg-bak."
	if [ -f /etc/sanewall/RESERVED_IPS.old ]; then
		mv -f /etc/sanewall/RESERVED_IPS.old /etc/sanewall/RESERVED_IPS.old.dpkg-bak
		echo "The existing RESERVED_IPS.old has been saved as RESERVED_IPS.old.dpkg-bak."
	fi
	echo
elif [ -f /etc/sanewall/RESERVED_IPS.old ]; then
	mv -f /etc/sanewall/RESERVED_IPS.old /etc/sanewall/RESERVED_IPS.old.dpkg-bak
	echo
	echo
	echo "Sanewall does not require the IANA Reserved IPS data file RESERVED_IPS."
	echo "The existing RESERVED_IPS.old has been saved as RESERVED_IPS.old.dpkg-bak."
	echo
fi