dayzdockerserver/files/mods/xml.sh
Daniel Ceregatti 2fc31fea37 The server doesn't like read only directories where it finds its files. Removing read-only flags from mounts for now.
Rework directories so there are fewer volumes within volumes.
Keep splitting up the code between the two scripts, removing unused variables, etc..
Add XML file merging integration. WIP.
Fix lack of comma in cfg file that _might_ have been causing issues...
2023-05-18 17:29:27 -07:00

25 lines
633 B
Bash
Executable file

#!/usr/bin/env bash
# A generic script to manage merging mod XML files to mpmissions XML files
set -eE
ID=${1}
source ${FILES}/mods/${ID}/xml.env
# Iterate over the file names we can handle
for var in CFGEVENTSPAWNS CFGSPAWNABLETYPES EVENTS TYPES
do
if echo ${!var} | grep -q http
then
OUT="${WORKSHOP_DIR}/${ID}/${var,,}.xml"
echo "${var} is a URL, downloading to ${OUT}"
curl -so ${OUT} ${!var}
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