F #165: Support timedatectl in TIMEZONE context

pull/188/head
Vlastimil Holer 5 years ago
parent 41ea670496
commit 4e6abbb589
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -16,10 +16,15 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
if [ -z "$TIMEZONE" ]; then if [ -z "${TIMEZONE}" ]; then
exit 0 exit 0
fi fi
if [ -f "/usr/share/zoneinfo/$TIMEZONE" ]; then if ! timedatectl set-timezone "${TIMEZONE}" 2>/dev/null; then
ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime if [ -f "/usr/share/zoneinfo/${TIMEZONE}" ]; then
ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime
else
echo "ERROR: Invalid timezone '${TIMEZONE}'" >&2
exit 1
fi
fi fi

Loading…
Cancel
Save