diff --git a/Dockerfile b/Dockerfile index f9e1683..64a1f0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ENV USER=borg ENV UID=1000 ENV GID=1000 ENV MAINTENANCE_ENABLE="false" +ENV TZ="" # Add Folders and Shell Scripts RUN mkdir "/.ssh" diff --git a/build.sh b/build.sh index 4038de7..12e2098 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,7 @@ run_docker_container() { -e UID=$(id -u) \ -e GID=$(id -g) \ -e MAINTENANCE_ENABLE="true" \ + -e TZ="Europe/Vienna" \ -v "$PWD"/crontab.txt:/crontab.txt \ -v "$PWD"/maintain_repo.sh:/maintain_repo.sh \ -v "$PWD"/sshkeys:/sshkeys \ diff --git a/entrypoint.sh b/entrypoint.sh index 89877e1..b9b62a4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -DOCKER_IMAGE_VERSION="1.0.6" +DOCKER_IMAGE_VERSION="1.0.7" sepurator() { echo "===============================================================================" @@ -24,9 +24,9 @@ adduser \ --home "/" \ --uid "$UID" \ "$USER" -echo "$USER:*" | chpasswd -addgroup -g "$GID" "$USER" -sepurator +echo "$USER:*" | chpasswd 2>> /logs/user.log +addgroup -g "$GID" "$USER" 2>> /logs/user.log + echo "* USER: $USER ID: $UID" echo "* GROUP: $USER GID: $GID" sepurator @@ -65,7 +65,7 @@ fi chown -R "$USER":"$USER" "/sshkeys/host" # MAINTENANCE_ENABLE of Borg Repository -if [ $MAINTENANCE_ENABLE != "false" ]; then +if [ "$MAINTENANCE_ENABLE" != "false" ]; then if [ -f "/crontab.txt" ]; then /usr/bin/crontab "/crontab.txt" /usr/sbin/crond -b @@ -76,6 +76,14 @@ if [ $MAINTENANCE_ENABLE != "false" ]; then sepurator fi +if [ "$TZ" != "" ]; then + echo "* Setting Timezone to $TZ" + echo "TZ=$TZ" > /etc/environment +else + echo "* Timezone not set - Use UTC Time" +fi +sepurator + echo "* Init done! - Starting SSH-Daemon..." sepurator -exec /usr/sbin/sshd -D -e "$@" +exec /usr/sbin/sshd -D -e "$@" 2>> /logs/sshd.log