This commit is contained in:
2023-11-29 06:30:19 -06:00
parent bb3ac16365
commit 0fe8c31b72

View File

@@ -18,12 +18,24 @@
# ===================================================
echo "Starting, attempting to load globals.sh"
# grab fresh copy of all helper scripts / libraries
if [ -d "$PWD/lib" ] ; then
cp -f "$PWD/lib"/* .
# if we are called externally by one of the servers,
# the command will be "~/dayz-servers/modserver_update.sh"
# we need to change from $PWD to accomodate for that
export WORKING_DIR=$PWD
if [ ! -d "$WORKING_DIR"/lib ] ; then
export WORKING_DIR="$HOME/dayz-servers"
if [ ! -d "$WORKING_DIR"/lib ] ; then
>&2 echo "Could not find lib. Exiting"
exit 1
fi
fi
GLOBALS_FILE="$PWD/globals.sh"
# grab fresh copy of all helper scripts / libraries
if [ -d "$WORKING_DIR/lib" ] ; then
cp -f "$WORKING_DIR/lib"/* .
fi
GLOBALS_FILE="$WORKING_DIR/globals.sh"
if [ -e "$GLOBALS_FILE" ] ; then
chmod +x "$GLOBALS_FILE"
. "$GLOBALS_FILE"
@@ -36,7 +48,7 @@ fi
# 02. Local script variables
# ===================================================
export STEAMCMD_USER=steam
export MODLISTS="$PWD/modlists"
export MODLISTS="$WORKING_DIR/modlists"
export LOCAL_STOCK="$HOME/stock"
export LOCAL_STOCK_GAME="$LOCAL_STOCK/DayZ"