create LOG_DIR before accessing it

This commit is contained in:
Tom Reynolds 2018-06-20 22:57:00 +02:00
parent 1caed4accc
commit 889e247406
1 changed files with 1 additions and 0 deletions

View File

@ -102,6 +102,7 @@ SERVER_SCRIPT="$(basename "$0")"
if [ -f "$GAMEDIR/glest.ini" ]; then
GLEST_INI="$(cat "$GAMEDIR/glest.ini" | sed -e 's:\$HOME:'"$HOME_DIR"':g')"
LOG_DIR="$(echo "$GLEST_INI" | grep '^LogPath=' | awk -F '=' '{print $2}')"
mkdir -p "$LOG_DIR"
# e.g. on macos are problems with more advanced using awk ^
if [ "$LOG_DIR" != "" ] && [ "$(echo "$LOG_DIR" | grep '/$')" ]; then LOG_DIR="${LOG_DIR%?}"; fi
MASTER_SERVER="$(echo "$GLEST_INI" | grep '^Masterserver=' | awk -F '=' '{print $2}')"