This file is indexed.

postinst is in mono-apache-server2 3.0.11-1.

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

. /usr/share/debconf/confmodule
db_version 2.0

modmono_default="/etc/default/mono-apache-server2"

# create file if it doesn't exist
if [ ! -e $modmono_default ]; then
	cat > $modmono_default <<-END
	# Defaults for mono-apache-server2

	# Should mono-apache-server2 start apache?
	start_apache=false
	END
fi

restart_apache_on() {
    sed s/start_apache=false/start_apache=true/g $modmono_default > $tempfile
    cp $tempfile $modmono_default
}

restart_apache_off() {
    sed s/start_apache=true/start_apache=false/g $modmono_default > $tempfile
    cp $tempfile $modmono_default
}

daemon_turn_off() {
    if [ -x /etc/init.d/mono-server2 ]; then
	update-rc.d -f mono-server2 remove > /dev/null
    fi
}

case "$1" in
    configure)
	tempfile=$(/bin/tempfile)
	
	db_get monoserver2/monoserver2_restartapache || true
	daemon_turn_off
	if [ "$RET" = "true" ]; then
	    restart_apache_on
	else
	    restart_apache_off
	fi

	mono-server2-update
	rm $tempfile
	;;
esac



exit 0