dayzdockerserver/files/bin/xml.sh
Daniel Ceregatti 8db515313b Add mod search.
Renamed main container to web.
Added the STEAMAPIKEY environment variable placeholder, as this is necessary when searching for mods.
Refactor locations of scripts and paths.
Rename start scripts to be more consistent with their new locations.
Run the web server under nodemon to prevent manual restarting.
2023-05-25 17:32:58 -07:00

26 lines
697 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}
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