mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 14:21:18 +00:00
Merge branch 'main' into two-servers
This commit is contained in:
commit
2f1f30fd6b
6 changed files with 42 additions and 21 deletions
|
@ -2,11 +2,17 @@
|
|||
|
||||
set -eE
|
||||
|
||||
if [ -f /files/mods/${1}/map.env ]
|
||||
TERM="map"
|
||||
if [[ ${1} =~ ^[0-9]+$ ]]
|
||||
then
|
||||
source /files/mods/${1}/map.env
|
||||
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 mod id ${1}..."
|
||||
echo "map.env not found for ${TERM} ${1}..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -14,17 +20,18 @@ 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" ]]
|
||||
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
|
||||
elif [[ ${2} = "update" ]] || [[ ${2} = "install" ]]
|
||||
then
|
||||
cd /tmp
|
||||
git clone ${REPO} 2> /dev/null 1> /dev/null
|
||||
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions
|
||||
rm -rf ${DIR}
|
||||
elif [[ ${2} = "install" ]]
|
||||
then
|
||||
cd /tmp
|
||||
git clone ${REPO} 2> /dev/null 1> /dev/null
|
||||
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions
|
||||
rm -rf ${DIR}
|
||||
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
|
||||
|
|
1
files/mods/1991570984/xml.env
Normal file
1
files/mods/1991570984/xml.env
Normal file
|
@ -0,0 +1 @@
|
|||
TYPES=./extras/msp_types.xml
|
1
files/mods/@MuchStuffPack
Symbolic link
1
files/mods/@MuchStuffPack
Symbolic link
|
@ -0,0 +1 @@
|
|||
1991570984
|
6
files/mods/enoch/map.env
Normal file
6
files/mods/enoch/map.env
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MAP="Enoch"
|
||||
DIR="DayZ-Central-Economy"
|
||||
REPO="https://github.com/BohemiaInteractive/${DIR}.git"
|
||||
MPDIR="dayzOffline.enoch"
|
|
@ -16,6 +16,7 @@ RUN sed -i /etc/apt/sources.list.d/debian.sources -e 's/Components: main/Compone
|
|||
RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \
|
||||
binutils \
|
||||
curl \
|
||||
git \
|
||||
gwenhywfar-tools \
|
||||
jq \
|
||||
libxml2-utils \
|
||||
|
|
19
web/bin/dz
19
web/bin/dz
|
@ -56,7 +56,6 @@ installxml(){
|
|||
do
|
||||
var=$(echo ${i} | cut -d: -f1)
|
||||
CHECK=$(echo ${i} | cut -d: -f2)
|
||||
CHILD=$(echo ${i} | cut -d: -f3)
|
||||
if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ]
|
||||
then
|
||||
echo "Normalizing ${WORKSHOP_DIR}/${ID}/${var,,}.xml..."
|
||||
|
@ -127,13 +126,14 @@ add(){
|
|||
|
||||
# Remove a mod
|
||||
remove(){
|
||||
if [ -d "${WORKSHOP_DIR}/${1}" ]
|
||||
DIR="${WORKSHOP_DIR}/${1:?}"
|
||||
if [ -d "${DIR}" ]
|
||||
then
|
||||
MODNAME=$(get_mod_name ${1})
|
||||
echo "Removing directory ${WORKSHOP_DIR}/${1}"
|
||||
rm -rf "${WORKSHOP_DIR}/${1}"
|
||||
echo "Removing directory ${DIR}"
|
||||
rm -rf "${DIR}"
|
||||
else
|
||||
echo "Directory ${WORKSHOP_DIR}/${1} doesn't exist?"
|
||||
echo "Directory ${DIR} doesn't exist?"
|
||||
fi
|
||||
if [ -L "${SERVER_FILES}/@${MODNAME}" ]
|
||||
then
|
||||
|
@ -305,9 +305,14 @@ Mods: "
|
|||
|
||||
map(){
|
||||
# Install map mpmissions for mods that have them. Presumes a map.env was created for the mod, with the required metadata (git URL, etc.)
|
||||
if [ -f ${FILES}/mods/${1}/map.env ]
|
||||
TERM="map"
|
||||
if [[ "${1}" =~ ^[0-9]+$ ]]
|
||||
then
|
||||
TERM="mod id"
|
||||
fi
|
||||
if [ -f "${FILES}/mods/${1}/map.env" ]
|
||||
then
|
||||
echo "Installing mpmissions files for mod id ${1}..."
|
||||
echo "Installing mpmissions files for ${TERM} ${1}..."
|
||||
source ${FILES}/mods/${1}/map.env
|
||||
${FILES}/bin/map.sh ${1} install
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue