mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 22:31: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
|
set -eE
|
||||||
|
|
||||||
if [ -f /files/mods/${1}/map.env ]
|
TERM="map"
|
||||||
|
if [[ ${1} =~ ^[0-9]+$ ]]
|
||||||
then
|
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
|
else
|
||||||
echo "map.env not found for mod id ${1}..."
|
echo "map.env not found for ${TERM} ${1}..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -14,17 +20,18 @@ if [[ ${2} = "uninstall" ]]
|
||||||
then
|
then
|
||||||
echo "Backing up, as uninstalling will remove the ${MAP} mpmissions directory"
|
echo "Backing up, as uninstalling will remove the ${MAP} mpmissions directory"
|
||||||
dz backup
|
dz backup
|
||||||
rm -rf ${SERVER_FILES}/mpmissions/${MPDIR}
|
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
|
||||||
elif [[ ${2} = "update" ]]
|
elif [[ ${2} = "update" ]] || [[ ${2} = "install" ]]
|
||||||
then
|
then
|
||||||
cd /tmp
|
cd /tmp
|
||||||
git clone ${REPO} 2> /dev/null 1> /dev/null
|
if [ -d "${DIR}" ]
|
||||||
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions
|
then
|
||||||
rm -rf ${DIR}
|
pushd "${DIR}" > /dev/null
|
||||||
elif [[ ${2} = "install" ]]
|
git pull
|
||||||
then
|
popd > /dev/null
|
||||||
cd /tmp
|
else
|
||||||
git clone ${REPO} 2> /dev/null 1> /dev/null
|
git clone "${REPO}"
|
||||||
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions
|
fi
|
||||||
rm -rf ${DIR}
|
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
|
||||||
|
cp -a "${DIR}/${MPDIR}" "${SERVER_FILES}/mpmissions"
|
||||||
fi
|
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 \
|
RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \
|
||||||
binutils \
|
binutils \
|
||||||
curl \
|
curl \
|
||||||
|
git \
|
||||||
gwenhywfar-tools \
|
gwenhywfar-tools \
|
||||||
jq \
|
jq \
|
||||||
libxml2-utils \
|
libxml2-utils \
|
||||||
|
|
19
web/bin/dz
19
web/bin/dz
|
@ -56,7 +56,6 @@ installxml(){
|
||||||
do
|
do
|
||||||
var=$(echo ${i} | cut -d: -f1)
|
var=$(echo ${i} | cut -d: -f1)
|
||||||
CHECK=$(echo ${i} | cut -d: -f2)
|
CHECK=$(echo ${i} | cut -d: -f2)
|
||||||
CHILD=$(echo ${i} | cut -d: -f3)
|
|
||||||
if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ]
|
if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ]
|
||||||
then
|
then
|
||||||
echo "Normalizing ${WORKSHOP_DIR}/${ID}/${var,,}.xml..."
|
echo "Normalizing ${WORKSHOP_DIR}/${ID}/${var,,}.xml..."
|
||||||
|
@ -127,13 +126,14 @@ add(){
|
||||||
|
|
||||||
# Remove a mod
|
# Remove a mod
|
||||||
remove(){
|
remove(){
|
||||||
if [ -d "${WORKSHOP_DIR}/${1}" ]
|
DIR="${WORKSHOP_DIR}/${1:?}"
|
||||||
|
if [ -d "${DIR}" ]
|
||||||
then
|
then
|
||||||
MODNAME=$(get_mod_name ${1})
|
MODNAME=$(get_mod_name ${1})
|
||||||
echo "Removing directory ${WORKSHOP_DIR}/${1}"
|
echo "Removing directory ${DIR}"
|
||||||
rm -rf "${WORKSHOP_DIR}/${1}"
|
rm -rf "${DIR}"
|
||||||
else
|
else
|
||||||
echo "Directory ${WORKSHOP_DIR}/${1} doesn't exist?"
|
echo "Directory ${DIR} doesn't exist?"
|
||||||
fi
|
fi
|
||||||
if [ -L "${SERVER_FILES}/@${MODNAME}" ]
|
if [ -L "${SERVER_FILES}/@${MODNAME}" ]
|
||||||
then
|
then
|
||||||
|
@ -305,9 +305,14 @@ Mods: "
|
||||||
|
|
||||||
map(){
|
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.)
|
# 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
|
then
|
||||||
echo "Installing mpmissions files for mod id ${1}..."
|
echo "Installing mpmissions files for ${TERM} ${1}..."
|
||||||
source ${FILES}/mods/${1}/map.env
|
source ${FILES}/mods/${1}/map.env
|
||||||
${FILES}/bin/map.sh ${1} install
|
${FILES}/bin/map.sh ${1} install
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue