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