File: websimba.postinst

package info (click to toggle)
simba 0.8.4-6
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 576 kB
  • sloc: perl: 2,645; sh: 163; makefile: 51
file content (71 lines) | stat: -rw-r--r-- 1,424 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
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
set -e


#
# Skip, if we are not in "configure" state
# 
if [ "$1" != "configure" ]; then
	echo "I: Skipping configuration"
	cleanup
	exit 0
fi
version="$2"


## Source debconf library
. /usr/share/debconf/confmodule
db_version 2.0

#
# retrieve various configuration options from debconf
#
db_get websimba/webserver
WWWTYPE="$RET"


# update the webserver, if needed
echo -n "I: Installing apache config files:"
case "$WWWTYPE" in
	"Apache")
		webservers="apache" ;;
	"Apache-SSL")
		webservers="apache-ssl" ;;
	"Apache2")
		webservers="apache2" ;;
	"All")
		webservers="apache apache-ssl apache2" ;;
	*)
		webservers="" ;;
esac
. /usr/share/wwwconfig-common/php.get
. /usr/share/wwwconfig-common/apache-run.get

for server in $webservers; do
	echo -n " $server"

	# prefer conf.d over monolithic form
	if [ -d "/etc/${server}/conf.d" ]; then
		if [ ! -h "/etc/${server}/conf.d/simba.conf" ] ; then
			ln -s ../../simba/apache.conf "/etc/${server}/conf.d/simba.conf"
		fi
		restart="$server $restart"
	else
		includefile="/etc/simba/apache.conf"
		. /usr/share/wwwconfig-common/apache-include_all.sh
		test "$status" = "uncomment" || "$status" = "include" && restart="$server $restart"
	fi

	for index in index.php; do
		. /usr/share/wwwconfig-common/apache-index_all.sh
		test "$status" = "added" && restart="$server $restart"
	done

	. /usr/share/wwwconfig-common/restart.sh
done
echo "."

#DEBHELPER#

exit 0