summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarracuda Team2013-04-15 17:53:11 (GMT)
committer Barracuda Team2013-04-15 17:53:11 (GMT)
commit0c7990669cecb9acc854719e391e393c6bf04811 (patch)
treef887560000ccda09d81a77c1d9a7cefd3138791c
parent0f61bdfb34105ec25c821b0b0643d248f34cc660 (diff)
Issue #1963044 by EdNet - Force UTF-8 locales if not present/configured properly.
-rwxr-xr-xBARRACUDA.sh.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/BARRACUDA.sh.txt b/BARRACUDA.sh.txt
index 350c616..8a39bd8 100755
--- a/BARRACUDA.sh.txt
+++ b/BARRACUDA.sh.txt
@@ -2117,9 +2117,15 @@ tune_memory_limits () {
#
# Fix locales.
fix_locales () {
+ _LOCALE_TEST=BROKEN
_LOC_TEST=`locale 2>&1`
+ if [[ "$_LOC_TEST" =~ "UTF-8" ]] ; then
+ _LOCALE_TEST=OK
+ fi
if [[ "$_LOC_TEST" =~ "Cannot" ]] ; then
_LOCALE_TEST=BROKEN
+ fi
+ if [ "$_LOCALE_TEST" = "BROKEN" ] ; then
msg "WARNING!"
cat <<EOF
@@ -2153,7 +2159,6 @@ EOF
echo "export LC_ALL=en_US.UTF-8" >> /root/.bashrc
echo "export LANGUAGE=en_US.UTF-8" >> /root/.bashrc
else
- _LOCALE_TEST=OK
locale-gen en_US en_US.UTF-8 &> /dev/null
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 &> /dev/null
fi