aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-10-17 20:55:38 +0200
committerTom Gundersen <teg@jklm.no>2011-10-18 09:36:22 +0200
commit137a7347ff975e4988d7fd999a0a6c32fee0464b (patch)
treef07ced1072d2b204d80e063e3a75d7a80d8786b4 /functions
parent4f4681a94923e69b9e078db6f2cae585ecbbb612 (diff)
downloadinitscripts-137a7347ff975e4988d7fd999a0a6c32fee0464b.tar.xz
locale.sh: support /etc/locale.conf
This is mainly to support non-bash shells that cannot source rc.conf. The format of /etc/locale.conf is described here: <http://0pointer.de/public/systemd-man/locale.conf.html>. If LANG is not set in locale.conf, then we fall back to LOCALE from rc.conf, as before. Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'functions')
-rw-r--r--functions8
1 files changed, 6 insertions, 2 deletions
diff --git a/functions b/functions
index 2ea81f9..68f4229 100644
--- a/functions
+++ b/functions
@@ -67,8 +67,12 @@ unset TZ
unset LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE \
LC_MEASUREMENT LC_IDENTIFICATION LC_ALL
-if [[ $DAEMON_LOCALE = [yY][eE][sS] && $LOCALE ]]; then
- export LANG="${LOCALE}"
+if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then
+ if [ -r /etc/locale.conf ]; then
+ . /etc/locale.conf
+ else
+ export LANG="${LOCALE}"
+ fi
else
export LANG=C
fi