1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/bin/bash # # 3DS Server Transaction Log Migration CLI tool script. usage() { cat <<EOF This script is used to start and pass commands to 3DS Server Transaction Log Migration CLI Tool. Usage: $0 <options> <argument> OPTIONS: -c The configuration home directory EOF } # Set defaults for command line arguments THREEDS_TRANSACTION_CLI_TOOL_HOME=$( cd $( dirname "$0" )/..; pwd ) THREEDS_TOOL_JAR= "$THREEDS_TRANSACTION_CLI_TOOL_HOME/lib/nca-3dss-transaction-cli-tool.jar" THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME= "$THREEDS_TRANSACTION_CLI_TOOL_HOME/conf/" while getopts ":c:" OPTION; do case ${OPTION} in c) THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME=$OPTARG ;; \?) usage ;; :) echo "Invalid option: $OPTARG requires an argument" 1>&2 ;; esac done # if THREEDS_CLI_TOOL_CONFIG_HOME is a directory, add / here if [[ -d $THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME ]]; then config_length=${ #THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME} last_char=${THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME:config_length-1:1} [ $last_char != "/" ] && THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME= "$THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME/" ; else echo "$THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME is not a directory" ; exit 1; fi JAVA_OPTS= "-Dspring.config.name=application -Dspring.config.additional-location=$THREEDS_TRANSACTION_CLI_TOOL_CONFIG_HOME" java $JAVA_OPTS -jar $THREEDS_TOOL_JAR |