From 6ccdfc95c331f328ba71dfb5f6f36702f87338c6 Mon Sep 17 00:00:00 2001 From: "James Z.M. Gao" Date: Tue, 3 May 2016 08:53:33 +0800 Subject: add Dockerfile --- content/opt/davmail/entrypoint.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 content/opt/davmail/entrypoint.sh (limited to 'content/opt') diff --git a/content/opt/davmail/entrypoint.sh b/content/opt/davmail/entrypoint.sh new file mode 100755 index 0000000..7b3b518 --- /dev/null +++ b/content/opt/davmail/entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh -el + +[ -z "$*" ] || exec "$@" + +CONFIG=${1:-/etc/davmail/davmail.properties} +if [ -n "$DAVMAIL_CONFIG_URL" ]; then + CONFIG=$HOME/davmail.properties + wget -qO $CONFIG "$DAVMAIL_CONFIG_URL" +elif [ -n "$DAVMAIL_URL" ]; then + CONFIG=$HOME/davmail.properties + while read line; do + eval echo "$line" + done < /etc/davmail/davmail.properties.template > $CONFIG +fi + +if [ -r "$CONFIG" ]; then + exec /opt/davmail/davmail.sh "$CONFIG" +else + echo "ERROR: can't read [$CONFIG]!" + return 1 +fi -- cgit v1.2.3