Skip to content

Commit

Permalink
Correction in docker-entrypoint.sh
Browse files Browse the repository at this point in the history
Container didn't work if timezone was not linked
  • Loading branch information
SuperITMan committed Aug 14, 2016
1 parent 6591d5f commit 2fbb16e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

function setTimeZone {
CLIENT_TIMEZONE=$(cat /etc/timezone)
HOST_TIMEZONE=$(cat /etc/timezone.host)
if [ -f "/etc/timezone.host" ]; then
CLIENT_TIMEZONE=$(cat /etc/timezone)
HOST_TIMEZONE=$(cat /etc/timezone.host)

if [ "${CLIENT_TIMEZONE}" != "${HOST_TIMEZONE}" ]; then
echo "Reconfigure timezone to "${HOST_TIMEZONE}
echo ${HOST_TIMEZONE} > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
if [ "${CLIENT_TIMEZONE}" != "${HOST_TIMEZONE}" ]; then
echo "Reconfigure timezone to "${HOST_TIMEZONE}
echo ${HOST_TIMEZONE} > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
fi
fi
}

Expand Down

0 comments on commit 2fbb16e

Please sign in to comment.