mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 22:31:18 +00:00
Make configuration changes come from changes to the files rather than setting environment variables.
Updated documentation.
This commit is contained in:
parent
b141d2b0da
commit
6be82b1adc
4 changed files with 17 additions and 15 deletions
13
README.md
13
README.md
|
@ -1,12 +1,19 @@
|
||||||
# DayZDockerServer
|
# DayZDockerServer
|
||||||
|
|
||||||
A Linux DayZ server in a Docker container.
|
A Linux DayZ server in a Docker container. Uses a modified version of https://github.com/thelastnoc/dayz-sa_linuxserver
|
||||||
|
|
||||||
Edit docker-compose.yml and set the server name:
|
### Setup
|
||||||
|
|
||||||
|
Edit `files/serverDZ.cfg` and set the server name:
|
||||||
|
|
||||||
```
|
```
|
||||||
- SERVERNAME=DayZ on Linux
|
hostname = "Something other than Server Name"; // Server name
|
||||||
```
|
```
|
||||||
|
Optionally edit `files/beserver_x64.cfg` and set the rcon password:
|
||||||
|
```
|
||||||
|
RConPassword h4CKm3
|
||||||
|
```
|
||||||
|
### Running
|
||||||
Build the container, run it, tail the logs:
|
Build the container, run it, tail the logs:
|
||||||
```
|
```
|
||||||
docker-compose build
|
docker-compose build
|
||||||
|
|
|
@ -12,9 +12,4 @@ services:
|
||||||
- "27016:27016/udp"
|
- "27016:27016/udp"
|
||||||
volumes:
|
volumes:
|
||||||
- homedir:/home/user
|
- homedir:/home/user
|
||||||
- ./files:/files
|
- ./files:/files
|
||||||
environment:
|
|
||||||
# Don't use double quotes. Escape any forward slashes: SERVERNAME=My thing \/ My other thing
|
|
||||||
- SERVERNAME=DayZ on Linux for Linux
|
|
||||||
# Set your own RCON password. Otherwise, a random one will be generated and shown in the log on the first run.
|
|
||||||
# - RCON_PASSWORD=H4CKM3
|
|
|
@ -45,16 +45,16 @@ fn_loadconfig_dayz(){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set a random RCON password, unless one's set in the environment
|
# Set a random RCON password, unless one's set in the environment
|
||||||
if [ ! -f "${HOME}/serverfiles/battleye/beserver_x64.cfg" ]
|
if [ -d "${HOME}/serverfiles" ] && [ ! -f "${HOME}/serverfiles/battleye/beserver_x64.cfg" ]
|
||||||
then
|
then
|
||||||
echo -n "Creating Battle Eye RCON file "
|
echo -n "Creating Battle Eye RCON file "
|
||||||
cp /files/beserver_x64.cfg "${HOME}/serverfiles/battleye/beserver_x64.cfg"
|
cp /files/beserver_x64.cfg "${HOME}/serverfiles/battleye/beserver_x64.cfg"
|
||||||
if [[ ${RCON_PASSWORD} != "" ]]
|
if grep RCON_PASSWORD /files/beserver_x64.cfg
|
||||||
then
|
then
|
||||||
echo "using the RCON_PASSWORD in the environment."
|
|
||||||
else
|
|
||||||
RCON_PASSWORD=$(< /dev/urandom tr -dc 'A-Za-z0-9' | head -c10)
|
RCON_PASSWORD=$(< /dev/urandom tr -dc 'A-Za-z0-9' | head -c10)
|
||||||
echo -e "using random RCON password ${yellow}${RCON_PASSWORD}"
|
echo -e "using random RCON password ${yellow}${RCON_PASSWORD}"
|
||||||
|
else
|
||||||
|
echo "using the RCON_PASSWORD already set in files/beserver_x64.cfg."
|
||||||
fi
|
fi
|
||||||
sed -i "${HOME}/serverfiles/battleye/beserver_x64.cfg" -e "s/RCON_PASSWORD/${RCON_PASSWORD}/"
|
sed -i "${HOME}/serverfiles/battleye/beserver_x64.cfg" -e "s/RCON_PASSWORD/${RCON_PASSWORD}/"
|
||||||
fi
|
fi
|
||||||
|
@ -489,7 +489,7 @@ if [ ! -f "${HOME}/steamcmd/steamcmd.sh" ] || [ ! -f "${HOME}/serverfiles/DayZSe
|
||||||
# chmod u+x ${HOME}/dayzserver
|
# chmod u+x ${HOME}/dayzserver
|
||||||
fn_install_dayz
|
fn_install_dayz
|
||||||
if [ -f "${HOME}/steamcmd/steamcmd.sh" ] && [ -f "${HOME}/serverfiles/DayZServer" ]; then
|
if [ -f "${HOME}/steamcmd/steamcmd.sh" ] && [ -f "${HOME}/serverfiles/DayZServer" ]; then
|
||||||
exec fn_start_dayz
|
fn_start_dayz
|
||||||
fi
|
fi
|
||||||
echo "Something failed? Shouldn't make it here..."
|
echo "Something failed? Shouldn't make it here..."
|
||||||
exit
|
exit
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hostname = "SERVER_NAME"; // Server name
|
hostname = "Server Name"; // Server name
|
||||||
password = ""; // Password to connect to the server
|
password = ""; // Password to connect to the server
|
||||||
passwordAdmin = ""; // Password to become a server admin
|
passwordAdmin = ""; // Password to become a server admin
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue