Skip to content

Commit

Permalink
fix confdir when computing static or dynamic temporary log directory (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur committed May 16, 2024
1 parent 98b0d6e commit 1b800cc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/lsc
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ fi
CFG_DIR="$LSC_HOME/etc"
LIB_DIR="$LSC_HOME/lib"

# Get configuration directory from command line
cfg_dir="${CFG_DIR}" # default value
while getopts "f:" opt > /dev/null 2>&1; do
case "${opt}" in
f) cfg_dir=${OPTARG}
;;
esac
done
# Get logdir property from logback.xml
logdir=$( grep 'property[ ]\+name="logdir"' "${CFG_DIR}/logback.xml" | sed -e 's/^.*value="\([^"]*\)".*$/\1/' )
logdir=$( grep 'property[ ]\+name="logdir"' "${cfg_dir}/logback.xml" | sed -e 's/^.*value="\([^"]*\)".*$/\1/' )
if [ "${logdir}" = "\${TMP_DIR}" ] || [ "${logdir}" = "\$TMP_DIR" ]; then
# Create temp directory
LOG_DIR="$( mktemp -d /tmp/lsc-$(date +%Y-%M-%d-%T).XXXXXXXXXX )"
Expand Down

0 comments on commit 1b800cc

Please sign in to comment.