mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 14:21:18 +00:00
Merge from main by hand.
This commit is contained in:
parent
960c5abf75
commit
24f9ff2508
5 changed files with 57 additions and 16 deletions
|
@ -13,12 +13,15 @@ volumes:
|
||||||
# For Steam, for now
|
# For Steam, for now
|
||||||
homedir_server1:
|
homedir_server1:
|
||||||
homedir_server2:
|
homedir_server2:
|
||||||
|
homedir_server3:
|
||||||
# Server mission files
|
# Server mission files
|
||||||
mpmissions1:
|
mpmissions1:
|
||||||
mpmissions2:
|
mpmissions2:
|
||||||
|
mpmissions3:
|
||||||
# Server profile files
|
# Server profile files
|
||||||
profiles1:
|
profiles1:
|
||||||
profiles2:
|
profiles2:
|
||||||
|
profiles3:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
@ -109,3 +112,25 @@ services:
|
||||||
restart: no
|
restart: no
|
||||||
env_file:
|
env_file:
|
||||||
- .env2 # <-- here
|
- .env2 # <-- here
|
||||||
|
|
||||||
|
server3: # <-- here
|
||||||
|
build:
|
||||||
|
context: server
|
||||||
|
args:
|
||||||
|
- USER_ID
|
||||||
|
user: ${USER_ID}
|
||||||
|
volumes:
|
||||||
|
# Common volumes
|
||||||
|
- ./files:/files
|
||||||
|
- mods:/mods
|
||||||
|
- ./server:/server
|
||||||
|
- serverfiles:/serverfiles
|
||||||
|
- servermpmissions:/mpmissions:ro
|
||||||
|
# Server-specific volumes
|
||||||
|
- homedir_server3:/home/user # <-- here
|
||||||
|
- mpmissions3:/serverfiles/mpmissions # <-- here
|
||||||
|
- profiles3:/profiles # <-- here
|
||||||
|
network_mode: host
|
||||||
|
restart: no
|
||||||
|
env_file:
|
||||||
|
- .env3 # <-- here
|
||||||
|
|
|
@ -6,6 +6,16 @@ set -eEa
|
||||||
# The steam query port is set in serverDZ.cfg.
|
# The steam query port is set in serverDZ.cfg.
|
||||||
|
|
||||||
# Server port. Set these in the .env file for the container.
|
# Server port. Set these in the .env file for the container.
|
||||||
|
if [[ ${SERVER_PORT} = "" ]]
|
||||||
|
then
|
||||||
|
export SERVER_PORT=2302
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${RCON_PORT} = "" ]]
|
||||||
|
then
|
||||||
|
export RCON_PORT=2303
|
||||||
|
fi
|
||||||
|
|
||||||
export port=${SERVER_PORT}
|
export port=${SERVER_PORT}
|
||||||
export rcon_port=${RCON_PORT}
|
export rcon_port=${RCON_PORT}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
MAP="Enoch"
|
MAP="Default Maps"
|
||||||
DIR="DayZ-Central-Economy"
|
DIR="DayZ-Central-Economy"
|
||||||
REPO="https://github.com/BohemiaInteractive/${DIR}.git"
|
REPO="https://github.com/BohemiaInteractive/${DIR}.git"
|
||||||
MPDIR="dayzOffline.enoch"
|
MPDIR="dayzOffline.*"
|
||||||
|
|
|
@ -5,7 +5,7 @@ source dz-common
|
||||||
# Server container base directories
|
# Server container base directories
|
||||||
MPMISSIONS="${SERVER_FILES}/mpmissions"
|
MPMISSIONS="${SERVER_FILES}/mpmissions"
|
||||||
|
|
||||||
mkdir -p ${SERVER_PROFILE}/battleye
|
mkdir -p "${SERVER_PROFILE}"/battleye
|
||||||
|
|
||||||
# Server configuration file
|
# Server configuration file
|
||||||
SERVER_CFG_FILE="serverDZ.cfg"
|
SERVER_CFG_FILE="serverDZ.cfg"
|
||||||
|
@ -138,15 +138,18 @@ mergexml(){
|
||||||
|
|
||||||
# Copy the pristine files from upstream
|
# Copy the pristine files from upstream
|
||||||
echo -e "${green}Copying upstream files into local mpmissions for map ${MAP}${default}":
|
echo -e "${green}Copying upstream files into local mpmissions for map ${MAP}${default}":
|
||||||
find /mpmissions/${MAP} \( \
|
# Not all maps have all files, so we need to check for their existence before copying them
|
||||||
-name "cfgeconomycore.xml" \
|
for i in "cfgeconomycore.xml" "cfgenvironment.xml" "cfgeventgroups.xml" "cfgeventspawns.xml" "cfggameplay.json" "cfgweather.xml" "init.c"
|
||||||
-o -name "cfgenvironment.xml" \
|
do
|
||||||
-o -name "cfgeventgroups.xml" \
|
if [ -f /mpmissions/${MAP}/${i} ]
|
||||||
-o -name "cfgeventspawns.xml" \
|
then
|
||||||
-o -name "cfggameplay.json" \
|
cp -v /mpmissions/${MAP}/${i} ${MPMISSIONS}/${MAP}/${i}
|
||||||
-o -name "cfgweather.xml" \
|
else
|
||||||
-o -name "init.c" \
|
# Copy it from the Chernarus map
|
||||||
\) -exec cp -v {} ${SERVER_FILES}{} \;
|
echo "The map ${MAP} does not have a ${i} file, copying from Chernarus..."
|
||||||
|
cp -v /mpmissions/dayzOffline.chernarusplus/${i} ${MPMISSIONS}/${MAP}/${i}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Same for any files in the db subdirectory we may modify
|
# Same for any files in the db subdirectory we may modify
|
||||||
find /mpmissions/${MAP}/db \( \
|
find /mpmissions/${MAP}/db \( \
|
||||||
|
@ -378,10 +381,8 @@ start(){
|
||||||
echo "Caught SIGTERM/SIGINT..."
|
echo "Caught SIGTERM/SIGINT..."
|
||||||
exit 0
|
exit 0
|
||||||
' SIGTERM SIGINT
|
' SIGTERM SIGINT
|
||||||
while [ true ]
|
tail -f /dev/null &
|
||||||
do
|
wait $!
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Clean up from previous runs
|
# Clean up from previous runs
|
||||||
|
|
|
@ -122,6 +122,7 @@ add(){
|
||||||
symlink 1 ${1} "${MODNAME}"
|
symlink 1 ${1} "${MODNAME}"
|
||||||
echo -e "Mod id ${1} - ${green}${MODNAME}${default} - added"
|
echo -e "Mod id ${1} - ${green}${MODNAME}${default} - added"
|
||||||
xml ${ID}
|
xml ${ID}
|
||||||
|
map ${ID}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove a mod
|
# Remove a mod
|
||||||
|
@ -190,6 +191,10 @@ install(){
|
||||||
printf "[ ${yellow}DayZ${default} ] Downloading DayZ Server-Files!\n"
|
printf "[ ${yellow}DayZ${default} ] Downloading DayZ Server-Files!\n"
|
||||||
dologin
|
dologin
|
||||||
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +app_update "${release_server_appid}" validate +quit
|
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +app_update "${release_server_appid}" validate +quit
|
||||||
|
# This installs the mpmissions for charnarusplus and enoch (AKA Livonia) from github. The game once allowed the full server
|
||||||
|
# to be downloaded, but now you get the server without any mpmissions. This is a workaround.
|
||||||
|
echo "Installing mpmissions for ChernarusPlus and Livonia from github..."
|
||||||
|
map default
|
||||||
else
|
else
|
||||||
printf "[ ${lightblue}DayZ${default} ] The server is already installed.\n"
|
printf "[ ${lightblue}DayZ${default} ] The server is already installed.\n"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue