mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 14:21:18 +00:00

Make development work by setting an environment variable. Set the web container to restart instead of not, should the express server crash. Copy XML files that are merged when the server starts only when the mpmissions directory exists. Refactor XML functions for better naming. Handle display of lists when no mods are installed. Add support for adding mpmissions for Deer Isle and mpmissions in general via mod integrations. Add support for Red Falcon Watercraft XML files. WIP. Add a deer isle DayZ bicycle spawn file.
39 lines
929 B
Bash
Executable file
39 lines
929 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# A generic script that retrieves XML files from mods, either upstream in remote endpoints, or
|
|
# locally from the downloaded mod directory
|
|
|
|
set -eE
|
|
|
|
ID=${1}
|
|
|
|
if ! [ -f ${FILES}/mods/${ID}/xml.env ]
|
|
then
|
|
exit 0
|
|
fi
|
|
|
|
source ${FILES}/mods/${ID}/xml.env
|
|
|
|
# Iterate over the file names we can handle
|
|
for var in CFGEVENTSPAWNS CFGSPAWNABLETYPES EVENTS TYPES
|
|
do
|
|
DIR="${WORKSHOP_DIR}/${ID}"
|
|
OUT="${DIR}/${var,,}.xml"
|
|
if echo ${!var} | grep -qE "^http"
|
|
then
|
|
echo "${var} is a URL, downloading to ${OUT}"
|
|
curl -so ${OUT} ${!var}
|
|
elif echo ${!var} | grep -qE "^\./"
|
|
then
|
|
echo "${var} is local, copying to ${OUT}"
|
|
cp -v "${DIR}/${!var}" "${OUT}"
|
|
fi
|
|
if [ -f ${OUT} ]
|
|
then
|
|
xmllint --noout ${OUT} 2> /dev/null || {
|
|
echo -e "${red}${var,,}.xml does not pass XML lint test!${default}"
|
|
} && {
|
|
echo -e "${green}${var,,}.xml passes XML lint test!${default}"
|
|
}
|
|
fi
|
|
done
|