Make relative PID_FOLDER and LOG_FOLDER absolute using jar's directory

Closes gh-7092
Closes gh-7093
This commit is contained in:
Andy Wilkinson
2016-10-14 09:19:11 +01:00
parent 03deff9a1c
commit 24f8c737fb
4 changed files with 17 additions and 2 deletions

View File

@@ -52,6 +52,8 @@ configfile="$(basename "${jarfile%.*}.conf")"
# Initialize PID/LOG locations if they weren't provided by the config file
[[ -z "$PID_FOLDER" ]] && PID_FOLDER="{{pidFolder:/var/run}}"
[[ -z "$LOG_FOLDER" ]] && LOG_FOLDER="{{logFolder:/var/log}}"
! [[ "$PID_FOLDER" == /* ]] && PID_FOLDER="$(dirname "$jarfile")"/"$PID_FOLDER"
! [[ "$LOG_FOLDER" == /* ]] && LOG_FOLDER="$(dirname "$jarfile")"/"$LOG_FOLDER"
! [[ -x "$PID_FOLDER" ]] && PID_FOLDER="/tmp"
! [[ -x "$LOG_FOLDER" ]] && LOG_FOLDER="/tmp"