diff options
Diffstat (limited to 'network/davmail/davmail.sh')
-rw-r--r-- | network/davmail/davmail.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/network/davmail/davmail.sh b/network/davmail/davmail.sh index 117fb8188a..4a2f245f6f 100644 --- a/network/davmail/davmail.sh +++ b/network/davmail/davmail.sh @@ -1,4 +1,15 @@ #!/bin/sh + BASE=/usr/share/davmail -for i in $BASE/lib/*; do export CLASSPATH=$CLASSPATH:$i; done -exec java -Xmx512M -Dsun.net.inetaddr.ttl=60 -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1 + +if [ -n "$JAVA_HOME" ]; then + JAVA_CMD="$JAVA_HOME/bin/java" +else + JAVA_CMD="$(which java)" +fi + +for i in $BASE/lib/*; do + export CLASSPATH=$CLASSPATH:$i; +done + +exec $JAVA_CMD -Xmx512M -Dsun.net.inetaddr.ttl=60 -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1 |