summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/20-prerequisites.inc
blob: 687b61397520febb60e8d35a8bcb0e128ec96973 (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"/config	# No point in testing.
	mkdir -p -m 700 "$BASEDIR"/temp

	# Old debugging config file there?
	[ -f "$LOGDIR/config" ] && cp -p "$LOGDIR/config" "$LOGDIR/config.prerun" 2>/dev/null

	# Let's look whether an english locale is alread active (we choose en_US.UTF-8)
	if [[ $(grep "en_US.UTF-8" /etc/locale.gen|cut -f 1 -d " ") == "#" ]]; then
		echo "# Generating an english locale (UTF-8)..."
		# Backing up never hurts:
		cp -p /etc/locale.gen /etc/locale.gen.orig
		# Now patch the localization file:
		sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
		dpkg-reconfigure locales
	else
		echo "# English locale detected; all is well."
	fi
}

preset_mysql_root() {
	# Presetting a root password for mysql so installer keeps quiet:
	debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASS"
	debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASS"
}