dayzdockerserver/files/bin/map.sh
Daniel Ceregatti 2f1509fb65 Change the default maps to always come from github. One used to be able to install the server using the anonymous steam user, but now the mpmissions aren't included if the anonymous user is used.
Handle multiple env files for now while we transition server orchestration entirely to the web container.
Add MuchStuffPack mod integration.
Add git to the web container so we can checkout server resources from github as git. Allows us to just pull on git to keep up to date.
2024-06-19 16:59:33 -07:00

37 lines
688 B
Bash
Executable file

#!/usr/bin/env bash
set -eE
TERM="map"
if [[ ${1} =~ ^[0-9]+$ ]]
then
TERM="mod id"
fi
if [ -f "/files/mods/${1}/map.env" ]
then
source "/files/mods/${1}/map.env"
else
echo "map.env not found for ${TERM} ${1}..."
exit 1
fi
if [[ ${2} = "uninstall" ]]
then
echo "Backing up, as uninstalling will remove the ${MAP} mpmissions directory"
dz backup
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
elif [[ ${2} = "update" ]] || [[ ${2} = "install" ]]
then
cd /tmp
if [ -d "${DIR}" ]
then
pushd "${DIR}" > /dev/null
git pull
popd > /dev/null
else
git clone "${REPO}"
fi
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
cp -a "${DIR}/${MPDIR}" "${SERVER_FILES}/mpmissions"
fi