From 517979f81ebe6cb6a833e9cbc067ace9f5a974e9 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Wed, 27 Jan 2021 21:30:38 +0100 Subject: [PATCH] Add usage --- tools/consumedir/consumedir-entrypoint.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/consumedir/consumedir-entrypoint.sh b/tools/consumedir/consumedir-entrypoint.sh index 575e7d11..dfd37155 100644 --- a/tools/consumedir/consumedir-entrypoint.sh +++ b/tools/consumedir/consumedir-entrypoint.sh @@ -9,6 +9,29 @@ # saner programming env: these switches turn some bugs into errors set -o errexit -o pipefail -o noclobber -o nounset +showUsage() { + echo "Options:" + echo " CONSUMEDIR_VERBOSE=y Print more to stdout." + echo " CONSUMEDIR_DELETE=y Delete the file if successfully uploaded. (value: $delete)" + echo " CONSUMEDIR_UNIQUE=y Optional. Upload only if the file doesn't already exist. (value: $distinct)" + echo " CONSUMEDIR_ONCE=y Instead of watching, upload all files in that dir." + echo " CONSUMEDIR_PATH=/opt/docs The directories to watch." + echo " CONSUMEDIR_POLLING=y Enables the polling mode instead of using inotifywait" + echo " CONSUMEDIR_POLLING_INTERVAL=60 Sets the interval for polling mode" + echo " CONSUMEDIR_ENDPOINT= Sets the endpoint URL" + echo " CONSUMEDIR_INTEGRATION=y Upload to the integration endpoint. It implies -r. This puts the script in" + echo " a different mode, where the first subdirectory of any given starting point" + echo " is read as the collective name. The url(s) are completed with this name in" + echo " order to upload files to the respective collective. So each directory" + echo " given is expected to contain one subdirectory per collective and the urls" + echo " are expected to identify the integration endpoint, which is" + echo " /api/v1/open/integration/item/. (value: $integration)" + echo " DOCSPELL_HEADER_VALUE= The header name and value to use with the integration endpoint. This must be" + echo " in form 'headername:value'. Only used if '-i' is supplied." + echo " CONSUMEDIR_ARGS= Allows to specify a custom command line that is passed to the consumedir script" + echo " CONSUMEDIR_SCRIPT= Allows to override the location of the consumedir script" +} + CONSUMEDIR_SCRIPT=${CONSUMEDIR_SCRIPT-${0/-entrypoint/}} CONSUMEDIR_PATH="${CONSUMEDIR_PATH-/opt/docs}" CONSUMEDIR_POLLING_INTERVAL=${CONSUMEDIR_POLLING_INTERVAL-60}