Bug #382: Enhance davmail script to allow overrides
It should be backwards compatible, but now you can pass in environmental variables (seen below) to override various default settings. Even better, if you just want to add java arguments (example: UI scaling) you can set JAVA_USER_OPTS and not have to worry about anything else.
Not fully tested since I don't have all of those environments.
CLASSPATH EXTRA_CLASSPATH JAVA JAVA_CORE_OPTS JAVA_EXTRA2_OPTS JAVA_EXTRA_OPTS JAVA_NET_OPTS_DFL JAVA_OPTS JAVA_USER_OPTS JFX_CLASSPATH LD_LIBRARY_PATH SWT_GTK3
This is a good idea, @SethRobertson ! May I suggest running the script through shellcheck (see https://www.shellcheck.net/)? It's an excellent linter for shell scripts. For example, it suggests using
: "${JAVA_CORE_OPTS:=-Xmx512M -Dsun.net.inetaddr.ttl=60}"
instead of
: ${JAVA_CORE_OPTS:="-Xmx512M -Dsun.net.inetaddr.ttl=60"}
Launch script changed quite a lot, merged the "override JAVA_OPTS" idea based on just 3 variables $BASE_JAVA_OPTS $JFX_JAVA_OPTS $SWT_JAVA_OPTS
Please test this to confirm it's working in various environments.