Skip to content
Snippets Groups Projects
Verified Commit 49b0fd64 authored by Olivier Benz's avatar Olivier Benz
Browse files

Update script 10-env.sh

parent 743f1055
No related branches found
No related tags found
No related merge requests found
Pipeline #31142 passed
......@@ -8,15 +8,11 @@ set -e
LANG=${LANG:=en_US.UTF-8}
TZ=${TZ:=Etc/UTC}
if [ "$(id -u)" == 0 ] ; then
# Update timezone if needed
if [ "$TZ" != "Etc/UTC" ]; then
_log "Setting TZ to $TZ"
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone
fi
# Info about timezone
_log "TZ is set to $TZ (/etc/localtime and /etc/timezone remain unchanged)"
# Add/Update locale if needed
if [ "$(id -u)" == 0 ] ; then
# Add/Update locale if requested
if [ -n "$LANGS" ]; then
for i in $LANGS; do
sed -i "s/# $i/$i/g" /etc/locale.gen
......@@ -29,14 +25,9 @@ if [ "$(id -u)" == 0 ] ; then
locale-gen --keep-existing
fi
update-locale --reset LANG="$LANG"
# Info about locale
_log "LANG is set to $LANG"
else
# Warn if the user wants to change the timezone but hasn't started the
# container as root.
if [ "$TZ" != "Etc/UTC" ]; then
_log "WARNING: Setting TZ to $TZ but /etc/localtime and /etc/timezone remain unchanged!"
fi
# Warn if the user wants to add locales but hasn't started the container as
# root.
if [ -n "$LANGS" ]; then
......@@ -48,6 +39,7 @@ else
. /etc/default/locale
_log "WARNING: Resetting LANG to $LANG"
else
# Info about locale
_log "LANG is set to $LANG"
fi
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment