CLOUDSTACK-7143: cleanup configure_locale.sh code

This commit is contained in:
Leo Simons 2014-07-21 11:16:48 +02:00 committed by Rohit Yadav
parent aa14a619a6
commit 6a688a0337

View File

@ -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