~andreserl/+junk/cobbler

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

set -e

if [ "$1" = "configure" ] ; then
	# Setup apache
	if [ -e /etc/cobbler/cobbler_web.conf -a \
		! -e /etc/apache2/conf.d/cobbler_web.conf ]; then
		ln -s /etc/cobbler/cobbler_web.conf /etc/apache2/conf.d/cobbler_web.conf 
	fi
	chown www-data:www-data /var/lib/cobbler/webui_sessions
	a2enmod proxy_http
	a2enmod wsgi

	# moved from cobbler.links
	ln -sf /usr/share/cobbler/webroot/cobbler /var/www/cobbler
	ln -sf /usr/share/cobbler/webroot/cobbler_webui_content /var/www/cobbler_webui_content
	ln -sf /etc/cobbler/cobbler.conf /etc/apache2/conf.d/cobbler.conf

	# create links to ubuntu fonts for branding.
	if [ -e /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf -a \
		! -e /usr/share/cobbler/webroot/cobbler_webui_content/Ubuntu-R.ttf ]; then
		ln -s /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf \
		    /usr/share/cobbler/webroot/cobbler_webui_content/Ubuntu-R.ttf
	fi
	if [ -e /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf -a \
		! -e /usr/share/cobbler/webroot/cobbler_webui_content/Ubuntu-B.ttf ]; then
		ln -s /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf \
		    /usr/share/cobbler/webroot/cobbler_webui_content/Ubuntu-B.ttf
	fi

	# Need to restart apache to pickup web configs
	if [ -f /etc/init.d/apache2 ]; then
		if [ -x /usr/sbin/invoke-rc.d ]; then
			invoke-rc.d apache2 restart || true
		else
			/etc/init.d/apache2 restart || true
		fi
	fi
fi

#DEBHELPER#