summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/20-prerequisites.inc
blob: 90189d86680e979c41e20d8f444a4483be535c9b (plain) (blame)
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
prerequisites() {
	mkdir -p -m 700 "$BASEDIR/temp"
	mkdir -p "/opt/openslx"

	# Enable en_US locale
	# Already there? Do nothing
	grep -q '^\s*en_US.UTF-8' /etc/locale.gen && return 0
	# Try to enable
	sed 's/^#\s*en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen

	if ! grep -q '^\s*en_US.UTF-8' /etc/locale.gen; then
		# Still not there, add
		echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
	fi

	# Regenerate
	dpkg-reconfigure locales
	if [ "$?" -ne 0 ]; then
		echo "#"
		echo "# WARNING: Could not reconfigure locales. This is annoying, as"
		echo "#          it will yield some mixed languages, perhaps."
		echo "#          Please make sure thy system has an UTF-8 based"
		echo "#          character set."
	fi
}