From 6a688a0337c4faa6b96552dccd620b3b58d00a4c Mon Sep 17 00:00:00 2001 From: Leo Simons Date: Mon, 21 Jul 2014 11:16:48 +0200 Subject: [PATCH] CLOUDSTACK-7143: cleanup configure_locale.sh code --- .../systemvmtemplate/configure_locale.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/appliance/definitions/systemvmtemplate/configure_locale.sh b/tools/appliance/definitions/systemvmtemplate/configure_locale.sh index 6619c6cf11b..8747a571d34 100644 --- a/tools/appliance/definitions/systemvmtemplate/configure_locale.sh +++ b/tools/appliance/definitions/systemvmtemplate/configure_locale.sh @@ -1,4 +1,14 @@ -fix_locale() { +#!/bin/bash + +set -e +set -x + +function configure_locale() { + grep LANG=en_US.UTF-8 /etc/default/locale && \ + grep LC_ALL=en_US.UTF-8 /etc/default/locale && \ + grep "en_US.UTF-8 UTF-8" /etc/locale.gen && + return + cat >> /etc/default/locale << EOF LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 @@ -10,4 +20,4 @@ EOF locale-gen en_US.UTF-8 } -fix_locale +return 2>/dev/null || configure_locale