summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/20-prerequisites.inc
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_installer/includes/20-prerequisites.inc')
-rw-r--r--satellit_installer/includes/20-prerequisites.inc42
1 files changed, 19 insertions, 23 deletions
diff --git a/satellit_installer/includes/20-prerequisites.inc b/satellit_installer/includes/20-prerequisites.inc
index e0dc9e0..90189d8 100644
--- a/satellit_installer/includes/20-prerequisites.inc
+++ b/satellit_installer/includes/20-prerequisites.inc
@@ -1,29 +1,25 @@
prerequisites() {
- mkdir -p -m 700 "$BASEDIR"/config # No point in testing.
- mkdir -p -m 700 "$BASEDIR"/temp
+ mkdir -p -m 700 "$BASEDIR/temp"
+ mkdir -p "/opt/openslx"
- # Old debugging config file there?
- [ -f "$CONFIGDIR/config" ] && cp -p "$CONFIGDIR/config" "$CONFIGDIR/config.prerun" 2>/dev/null
+ # 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
- # 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 -n "# Generating an english UTF-8 based locale (this may take some time)..."
- # 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 2>/dev/null 1>&2
- if [ "$ERR" -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."
- else
- echo " ok."
- fi
+ 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
- else
- echo "# English locale detected; all is well."
+ # 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
}