mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-07 06:41:17 +00:00
Remove all the Battle Eye rcon crap. Let the game manage that.
Remove the default.cfg file as that's just been incorporated into the dayzserver script. Set some saner defaults in serverDZ.cfg. Remove the faking of the install. Integrate steamcmd from Debian. Updated docs.
This commit is contained in:
parent
322ce732c5
commit
368ec600f7
7 changed files with 154 additions and 171 deletions
49
Dockerfile
49
Dockerfile
|
@ -1,30 +1,31 @@
|
||||||
FROM debian:bullseye
|
FROM debian:bullseye
|
||||||
|
|
||||||
# Replace shell with bash so we can source files
|
# Set debconf to run non-interactively and agree to the SteamCMD EULA
|
||||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
||||||
|
&& echo steam steam/question select "I AGREE" | debconf-set-selections \
|
||||||
# Set debconf to run non-interactively
|
&& echo steam steam/license note '' | debconf-set-selections \
|
||||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
&& dpkg --add-architecture i386
|
||||||
|
|
||||||
# Add contrib and backports
|
# Add contrib and backports
|
||||||
RUN sed -i /etc/apt/sources.list -e 's/main/main contrib/'
|
RUN sed -i /etc/apt/sources.list -e 's/main/main contrib non-free/'
|
||||||
|
|
||||||
#RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' >> /etc/apt/sources.list
|
RUN echo 'deb http://deb.debian.org/debian bullseye-backports main non-free' >> /etc/apt/sources.list
|
||||||
|
|
||||||
# Add 32 bit arch for steam crap
|
# Install _only_ the necessary packages
|
||||||
RUN dpkg --add-architecture i386
|
RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \
|
||||||
|
|
||||||
# Install necessary packages
|
|
||||||
RUN apt-get update && apt-get -y upgrade && apt-get -y install \
|
|
||||||
nano \
|
nano \
|
||||||
curl \
|
curl \
|
||||||
|
ca-certificates \
|
||||||
lib32gcc-s1 \
|
lib32gcc-s1 \
|
||||||
lib32stdc++6 \
|
lib32stdc++6 \
|
||||||
|
libcurl4:i386 \
|
||||||
|
libsdl2-2.0-0:i386 \
|
||||||
libcap2 \
|
libcap2 \
|
||||||
locales \
|
locales \
|
||||||
psmisc \
|
procps \
|
||||||
wget \
|
wget \
|
||||||
rename
|
rename \
|
||||||
|
steamcmd
|
||||||
|
|
||||||
# Set the locale
|
# Set the locale
|
||||||
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
||||||
|
@ -33,23 +34,17 @@ ENV LANG en_US.UTF-8
|
||||||
ENV LANGUAGE en_US:en
|
ENV LANGUAGE en_US:en
|
||||||
ENV LC_ALL en_US.UTF-8
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
|
||||||
# Add steamcmd to the image.
|
# steamcmd ends up in /usr/games
|
||||||
RUN mkdir -p /steamcmd && \
|
ENV PATH /usr/games:${PATH}
|
||||||
cd /steamcmd && \
|
|
||||||
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxf -
|
|
||||||
|
|
||||||
# Make our docker scripts easier to run
|
# Add the dayzserver to a directory in PATH. Might as well be /usr/games!
|
||||||
ENV PATH /files:/steamcmd:${PATH}
|
ADD files/dayzserver /usr/games
|
||||||
|
|
||||||
# Setup a non-privileged user
|
# Setup a non-privileged user
|
||||||
RUN groupadd user && \
|
RUN groupadd user && \
|
||||||
useradd -l -m -g user user
|
useradd -l -g user user && \
|
||||||
|
mkdir /home/user && \
|
||||||
# The volume needs to be owned by the user
|
chown user:user /home/user
|
||||||
RUN cd /home/user; rm -rf *; rm -rf .*; chown user:user /home/user -R
|
|
||||||
|
|
||||||
# SteamCMD wants to manage itself, so it has to be owned by the docker user.
|
|
||||||
RUN chown user:user /steamcmd -R
|
|
||||||
|
|
||||||
# Use our non-privileged user
|
# Use our non-privileged user
|
||||||
USER user
|
USER user
|
||||||
|
|
16
README.md
16
README.md
|
@ -1,9 +1,9 @@
|
||||||
# DayZDockerServer
|
# DayZDockerServer
|
||||||
|
|
||||||
A Linux DayZ server in a Docker container.
|
A Linux [DayZ](https://dayz.com) server in a [Docker](https://docs.docker.com/) container. The main script's
|
||||||
The main script's functionality is derived from [this project](https://github.com/thelastnoc/dayz-sa_linuxserver).
|
functionality is derived from [this project](https://github.com/thelastnoc/dayz-sa_linuxserver). That functionality is
|
||||||
That functionality is described [here](https://steamcommunity.com/sharedfiles/filedetails/?id=1517338673). The goal is
|
described [here](https://steamcommunity.com/sharedfiles/filedetails/?id=1517338673). The goal is to reproduce some of
|
||||||
to reproduce some of that functionality but also add more features.
|
that functionality but also add more features.
|
||||||
|
|
||||||
## Caveat Emptor
|
## Caveat Emptor
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@ This volume can get quite large. It will require at least 2G of disk space for t
|
||||||
|
|
||||||
## Configure and Build
|
## Configure and Build
|
||||||
|
|
||||||
|
Ensure [Docker](https://docs.docker.com/engine/install/) and [Docker compose](https://docs.docker.com/compose/install/)
|
||||||
|
are installed.
|
||||||
|
|
||||||
Edit `files/serverDZ.cfg` and set the values of any variables there.
|
Edit `files/serverDZ.cfg` and set the values of any variables there.
|
||||||
See the [documentation](https://forums.dayz.com/topic/239635-dayz-server-files-documentation/):
|
See the [documentation](https://forums.dayz.com/topic/239635-dayz-server-files-documentation/):
|
||||||
|
|
||||||
|
@ -65,6 +68,11 @@ docker-compose logs -f main
|
||||||
|
|
||||||
## Manage
|
## Manage
|
||||||
|
|
||||||
|
This just runs a bash shell in the container. It allows for the file system and files to be easily inspected.
|
||||||
|
### Shell in the container
|
||||||
|
```
|
||||||
|
docker-compose run --rm main bash
|
||||||
|
```
|
||||||
### RCON
|
### RCON
|
||||||
Show the current Battle Eye configuration file (Derived from `files/beserver_x64.cfg`):
|
Show the current Battle Eye configuration file (Derived from `files/beserver_x64.cfg`):
|
||||||
```
|
```
|
||||||
|
|
|
@ -13,6 +13,3 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- homedir:/home/user
|
- homedir:/home/user
|
||||||
- ./files:/files
|
- ./files:/files
|
||||||
# environment:
|
|
||||||
# # So we don't have to always download the full server when testing
|
|
||||||
# - FAKE_DAYZ_INSTALL=1
|
|
|
@ -1,3 +0,0 @@
|
||||||
RConPassword RCON_PASSWORD
|
|
||||||
RestrictRCon 1
|
|
||||||
RConPort 2302
|
|
208
files/dayzserver
208
files/dayzserver
|
@ -4,14 +4,31 @@
|
||||||
# FIXME Set this in Docker somewhere
|
# FIXME Set this in Docker somewhere
|
||||||
ulimit -c 0
|
ulimit -c 0
|
||||||
|
|
||||||
|
# DayZ SteamID
|
||||||
|
appid=1042420
|
||||||
|
dayz_id=221100
|
||||||
|
|
||||||
|
config=serverDZ.cfg
|
||||||
|
port=2302
|
||||||
|
profile="-profiles=${HOME}/serverprofile/"
|
||||||
|
|
||||||
|
# To log or not to log
|
||||||
|
#logs="-dologs -adminlog -netlog"
|
||||||
|
logs="-nologs"
|
||||||
|
|
||||||
|
# mods="@CF;@community-Online-Tools;@Banov;@SimpleAutorun"
|
||||||
|
mods=""
|
||||||
|
|
||||||
|
# modify carefully! server won't start if syntax is corrupt!
|
||||||
|
dayzparameter=" -config=${config} -port=${port} -mod='${mods}' -freezecheck ${profile} ${logs}"
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
default="\e[0m"
|
default="\e[0m"
|
||||||
red="\e[31m"
|
red="\e[31m"
|
||||||
green="\e[32m"
|
green="\e[32m"
|
||||||
yellow="\e[33m"
|
yellow="\e[93m"
|
||||||
lightyellow="\e[93m"
|
|
||||||
blue="\e[34m"
|
|
||||||
lightblue="\e[94m"
|
lightblue="\e[94m"
|
||||||
|
blue="\e[34m"
|
||||||
magenta="\e[35m"
|
magenta="\e[35m"
|
||||||
cyan="\e[36m"
|
cyan="\e[36m"
|
||||||
|
|
||||||
|
@ -20,15 +37,6 @@ CFG_SRC_FILES="/files"
|
||||||
SERVER_FILES="${HOME}/serverfiles"
|
SERVER_FILES="${HOME}/serverfiles"
|
||||||
SERVER_PROFILE="${HOME}/serverprofile"
|
SERVER_PROFILE="${HOME}/serverprofile"
|
||||||
|
|
||||||
# Default config file
|
|
||||||
DEFAULT_CFG="${CFG_SRC_FILES}/default.cfg"
|
|
||||||
|
|
||||||
# Battle Eye files
|
|
||||||
BE_SERVER_FILE="beserver_x64.cfg"
|
|
||||||
BE_SERVER_DIR="${SERVER_FILES}/battleye"
|
|
||||||
BE_SERVER_DST="${BE_SERVER_DIR}/${BE_SERVER_FILE}"
|
|
||||||
BE_SERVER_SRC="${CFG_SRC_FILES}/${BE_SERVER_FILE}"
|
|
||||||
|
|
||||||
# Server configuration file
|
# Server configuration file
|
||||||
SERVER_CFG_FILE="serverDZ.cfg"
|
SERVER_CFG_FILE="serverDZ.cfg"
|
||||||
SERVER_CFG_DST="${SERVER_FILES}/${SERVER_CFG_FILE}"
|
SERVER_CFG_DST="${SERVER_FILES}/${SERVER_CFG_FILE}"
|
||||||
|
@ -38,12 +46,41 @@ SERVER_CFG_SRC="${CFG_SRC_FILES}/${SERVER_CFG_FILE}"
|
||||||
SERVER_INSTALL_FILE="${SERVER_FILES}/DayZServer"
|
SERVER_INSTALL_FILE="${SERVER_FILES}/DayZServer"
|
||||||
|
|
||||||
# Steam files
|
# Steam files
|
||||||
STEAM_LOGIN_DST="${HOME}/steamlogin"
|
STEAM_LOGIN="${HOME}/steamlogin"
|
||||||
STEAMCMD=steamcmd.sh
|
STEAMCMD=steamcmd
|
||||||
|
|
||||||
# Workshop
|
# Workshop
|
||||||
WORKSHOP_CFG="${HOME}/workshop.cfg"
|
WORKSHOP_CFG="${HOME}/workshop.cfg"
|
||||||
|
|
||||||
|
# Other stuff
|
||||||
|
YES="${green}yes${default}"
|
||||||
|
NO="${red}no${default}"
|
||||||
|
|
||||||
|
fn_usage(){
|
||||||
|
echo -e "
|
||||||
|
${red}Bad option or arguments! ${yellow}${*}${default}
|
||||||
|
|
||||||
|
Usage: ${green}$(basename $0)${yellow} option [ arg1 [ arg2 ] ]
|
||||||
|
|
||||||
|
Options and arguments:
|
||||||
|
|
||||||
|
install - Install the DayZ server files
|
||||||
|
login - Login to Steam
|
||||||
|
rcon - RCON Features
|
||||||
|
say - Send a message to players on the server
|
||||||
|
status - Shows the server's status as well as the state of the server files and mods (Needs install, update, etc.)
|
||||||
|
stop - Stop the server
|
||||||
|
update - Update the DayZ server files
|
||||||
|
workshop - Workshop Features
|
||||||
|
activate id [id...] - Activate one or many installed DayZ Workshop item by id
|
||||||
|
add id [id...] - Add one or many DayZ Workshop items by id
|
||||||
|
deactivate id [id...] - Deactivate one or many installed DayZ Workshop items by id - Keeps the addon files but excludes from -mod=
|
||||||
|
list - List Workshop items and their states (Active vs. Non)
|
||||||
|
remove id [id...] - Remove one or many Workshop items by id
|
||||||
|
${default}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
fn_prompt_yn(){
|
fn_prompt_yn(){
|
||||||
echo -n "${1} (y|N) " >&2
|
echo -n "${1} (y|N) " >&2
|
||||||
read -s -n 1 a
|
read -s -n 1 a
|
||||||
|
@ -59,7 +96,6 @@ fn_prompt_yn(){
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_loadconfig_dayz(){
|
fn_loadconfig_dayz(){
|
||||||
source ${DEFAULT_CFG}
|
|
||||||
# Handle the server configuration file
|
# Handle the server configuration file
|
||||||
if [ ! -f ${SERVER_CFG_DST} ]
|
if [ ! -f ${SERVER_CFG_DST} ]
|
||||||
then
|
then
|
||||||
|
@ -80,42 +116,15 @@ fn_loadconfig_dayz(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Checks for the destination file are already done before calls to this
|
|
||||||
fn_do_rcon(){
|
|
||||||
if [ ! -d "${BE_SERVER_DIR}" ]
|
|
||||||
then
|
|
||||||
echo
|
|
||||||
echo -e "${yellow}DayZ is not installed yet. Can't manage RCON until then${default}"
|
|
||||||
echo
|
|
||||||
else
|
|
||||||
echo -n "Creating the Battle Eye configuration file "
|
|
||||||
cp "${BE_SERVER_SRC}" "${BE_SERVER_DST}"
|
|
||||||
# Set a random RCON password, unless one's set in the environment
|
|
||||||
if grep -q RCON_PASSWORD "${BE_SERVER_SRC}"
|
|
||||||
then
|
|
||||||
RCON_PASSWORD=$(< /dev/urandom tr -dc 'A-Za-z0-9' | head -c10)
|
|
||||||
echo -e "using random RCON password ${yellow}${RCON_PASSWORD}${default}"
|
|
||||||
sed -i "${BE_SERVER_DST}" -e "s/RCON_PASSWORD/${RCON_PASSWORD}/"
|
|
||||||
else
|
|
||||||
echo "using the RCON_PASSWORD already set in ${BE_SERVER_SRC}."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
fn_create_beconfig(){
|
|
||||||
if [ ! -f "${BE_SERVER_DST}" ]
|
|
||||||
then
|
|
||||||
echo -n "Creating Battle Eye RCON file "
|
|
||||||
fn_do_rcon
|
|
||||||
elif diff -q "${BE_SERVER_SRC}" "${BE_SERVER_DST}" > /dev/null
|
|
||||||
then
|
|
||||||
echo -n "Updating Battle Eye RCON file "
|
|
||||||
fn_do_rcon
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
fn_start_dayz(){
|
fn_start_dayz(){
|
||||||
fn_create_beconfig
|
# Check for interactive shell
|
||||||
|
if [ -t 0 ]
|
||||||
|
then
|
||||||
|
echo
|
||||||
|
echo -e "Not starting the server in an interactive shell. Start the server using '${green}docker-compose up -d${default}'"
|
||||||
|
echo
|
||||||
|
exit
|
||||||
|
fi
|
||||||
fn_loadconfig_dayz
|
fn_loadconfig_dayz
|
||||||
fn_workshop_mods
|
fn_workshop_mods
|
||||||
printf "[ ${green}DayZ${default} ] Starting server...\n"
|
printf "[ ${green}DayZ${default} ] Starting server...\n"
|
||||||
|
@ -140,18 +149,17 @@ fn_stop_dayz(){
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_steam_login(){
|
fn_steam_login(){
|
||||||
if [ -f "${STEAM_LOGIN_DST}" ]
|
if [ -f "${STEAM_LOGIN}" ]
|
||||||
then
|
then
|
||||||
if fn_prompt_yn "The steam login is already set. Reset it?"
|
if fn_prompt_yn "The steam login is already set. Reset it?"
|
||||||
then
|
then
|
||||||
rm -f "${STEAM_LOGIN_DST}"
|
rm -f "${STEAM_LOGIN}"
|
||||||
else
|
else
|
||||||
echo
|
echo "Not reset."
|
||||||
echo "Not reset. Nothing to do. Exiting..."
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -f "${STEAM_LOGIN_DST}" ]
|
if [ ! -f "${STEAM_LOGIN}" ]
|
||||||
then
|
then
|
||||||
echo "Setting up Steam credentials"
|
echo "Setting up Steam credentials"
|
||||||
echo -n "Steam Username (anonymous): "
|
echo -n "Steam Username (anonymous): "
|
||||||
|
@ -161,15 +169,15 @@ fn_steam_login(){
|
||||||
echo "Steam login set to 'anonymous'"
|
echo "Steam login set to 'anonymous'"
|
||||||
steamlogin="anonymous"
|
steamlogin="anonymous"
|
||||||
fi
|
fi
|
||||||
echo "steamlogin=${steamlogin}" > "${STEAM_LOGIN_DST}"
|
echo "steamlogin=${steamlogin}" > "${STEAM_LOGIN}"
|
||||||
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +quit
|
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +quit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_steamlogin_dayz(){
|
fn_steamlogin_dayz(){
|
||||||
if [ -f "${STEAM_LOGIN_DST}" ]
|
if [ -f "${STEAM_LOGIN}" ]
|
||||||
then
|
then
|
||||||
source "${STEAM_LOGIN_DST}"
|
source "${STEAM_LOGIN}"
|
||||||
else
|
else
|
||||||
echo "No cached Steam credentials. Please configure this now: "
|
echo "No cached Steam credentials. Please configure this now: "
|
||||||
fn_steam_login
|
fn_steam_login
|
||||||
|
@ -209,27 +217,26 @@ fn_update_dayz(){
|
||||||
fn_steamlogin_dayz
|
fn_steamlogin_dayz
|
||||||
fn_loadconfig_dayz
|
fn_loadconfig_dayz
|
||||||
appmanifestfile=${SERVER_FILES}/steamapps/appmanifest_"${appid}".acf
|
appmanifestfile=${SERVER_FILES}/steamapps/appmanifest_"${appid}".acf
|
||||||
printf "[ ... ] Checking for update: SteamCMD"
|
printf "[ ... ] Checking for update:"
|
||||||
# gets currentbuild
|
# gets currentbuild
|
||||||
currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d \ -f3)
|
currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d \ -f3)
|
||||||
# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD
|
# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD
|
||||||
if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then
|
if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then
|
||||||
rm -f "${HOME}/Steam/appcache/appinfo.vdf"
|
rm -f "${HOME}/Steam/appcache/appinfo.vdf"
|
||||||
sleep 1
|
|
||||||
fi
|
fi
|
||||||
# check for new build
|
# check for new build
|
||||||
availablebuild=$(${STEAMCMD} +login "${steamlogin}" +app_info_update 1 +app_info_print "${appid}" +app_info_print \
|
availablebuild=$(${STEAMCMD} +login "${steamlogin}" +app_info_update 1 +app_info_print "${appid}" +app_info_print \
|
||||||
"${appid}" +quit | sed -n '/branch/,$p' | grep -m 1 buildid | tr -cd '[:digit:]')
|
"${appid}" +quit | sed -n '/branch/,$p' | grep -m 1 buildid | tr -cd '[:digit:]')
|
||||||
if [ -z "${availablebuild}" ]; then
|
if [ -z "${availablebuild}" ]; then
|
||||||
printf "\r[ ${red}FAIL${default} ] Checking for update: SteamCMD\n"
|
printf "\r[ ${red}FAIL${default} ] Checking for update:\n"
|
||||||
printf "\r[ ${red}FAIL${default} ] Checking for update: SteamCMD: Not returning version info\n"
|
printf "\r[ ${red}FAIL${default} ] Checking for update:: Not returning version info\n"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
printf "\r[ ${green}OK${default} ] Checking for update: SteamCMD"
|
printf "\r[ ${green}OK${default} ] Checking for update:"
|
||||||
fi
|
fi
|
||||||
# compare builds
|
# compare builds
|
||||||
if [ "${currentbuild}" != "${availablebuild}" ]; then
|
if [ "${currentbuild}" != "${availablebuild}" ]; then
|
||||||
printf "\r[ ${green}OK${default} ] Checking for update: SteamCMD: Update available\n"
|
printf "\r[ ${green}OK${default} ] Checking for update:: Update available\n"
|
||||||
printf "Update available:\n"
|
printf "Update available:\n"
|
||||||
printf "\tCurrent build: ${red}${currentbuild}${default}\n"
|
printf "\tCurrent build: ${red}${currentbuild}${default}\n"
|
||||||
printf "\tAvailable build: ${green}${availablebuild}${default}\n"
|
printf "\tAvailable build: ${green}${availablebuild}${default}\n"
|
||||||
|
@ -239,7 +246,7 @@ fn_update_dayz(){
|
||||||
fn_runupdate_dayz
|
fn_runupdate_dayz
|
||||||
fn_workshop_mods
|
fn_workshop_mods
|
||||||
else
|
else
|
||||||
printf "\r[ ${green}OK${default} ] Checking for update: SteamCMD: No update available\n"
|
printf "\r[ ${green}OK${default} ] Checking for update:: No update available\n"
|
||||||
printf "\nNo update available:\n"
|
printf "\nNo update available:\n"
|
||||||
printf "\tCurrent version: ${green}${currentbuild}${default}\n"
|
printf "\tCurrent version: ${green}${currentbuild}${default}\n"
|
||||||
printf "\tAvailable version: ${green}${availablebuild}${default}\n"
|
printf "\tAvailable version: ${green}${availablebuild}${default}\n"
|
||||||
|
@ -289,40 +296,48 @@ fn_workshop_mods(){
|
||||||
|
|
||||||
fn_rcon(){
|
fn_rcon(){
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
show)
|
say)
|
||||||
if [ ! -f "${BE_SERVER_DST}" ]
|
echo "Sending message to server: '${1}'"
|
||||||
then
|
|
||||||
fn_do_rcon
|
|
||||||
fi
|
|
||||||
if [ -f "${BE_SERVER_DST}" ]
|
|
||||||
then
|
|
||||||
echo "=================================================================="
|
|
||||||
cat "${BE_SERVER_DST}"
|
|
||||||
echo "=================================================================="
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
reset)
|
**)
|
||||||
if fn_prompt_yn "Reset RCON password?"
|
fn_usage rcon "${1}"
|
||||||
then
|
|
||||||
rm -f "${BE_SERVER_DST}"
|
|
||||||
fn_do_rcon
|
|
||||||
else
|
|
||||||
echo
|
|
||||||
echo "Not reset. Nothing to do. Exiting..."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
fn_backup(){
|
fn_status(){
|
||||||
echo "Creating backup...WIP"
|
INSTALLED="${NO}"
|
||||||
|
LOGGED_IN="${NO}"
|
||||||
|
RUNNING="${NO}"
|
||||||
|
MOD_INSTALLED="${yellow}0${default}"
|
||||||
|
MOD_LIST=""
|
||||||
|
# DayZ Server files installation
|
||||||
|
if [ -f "${SERVER_INSTALL_FILE}" ]
|
||||||
|
then
|
||||||
|
INSTALLED="${YES}"
|
||||||
|
fi
|
||||||
|
# Logged into Steam
|
||||||
|
if [ -f "${STEAM_LOGIN}" ]
|
||||||
|
then
|
||||||
|
LOGGED_IN="${YES}"
|
||||||
|
fi
|
||||||
|
# Running or not
|
||||||
|
if pidof DayZServer
|
||||||
|
then
|
||||||
|
RUNNING="${YES}"
|
||||||
|
fi
|
||||||
|
# Number of mods plus the list denoting on or off
|
||||||
|
echo -e "
|
||||||
|
Status:
|
||||||
|
|
||||||
|
Logged in to Steam: ${LOGGED_IN}
|
||||||
|
Server files installed: ${INSTALLED}
|
||||||
|
Mods installed: ${MOD_INSTALLED}${MOD_LIST}
|
||||||
|
Server running: ${RUNNING}
|
||||||
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
backup)
|
|
||||||
fn_backup
|
|
||||||
;;
|
|
||||||
install)
|
install)
|
||||||
fn_install_dayz
|
fn_install_dayz
|
||||||
;;
|
;;
|
||||||
|
@ -332,6 +347,12 @@ case "${1}" in
|
||||||
rcon)
|
rcon)
|
||||||
fn_rcon "${2}"
|
fn_rcon "${2}"
|
||||||
;;
|
;;
|
||||||
|
start)
|
||||||
|
fn_start_dayz
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
fn_status
|
||||||
|
;;
|
||||||
stop)
|
stop)
|
||||||
fn_stop_dayz
|
fn_stop_dayz
|
||||||
;;
|
;;
|
||||||
|
@ -342,9 +363,6 @@ case "${1}" in
|
||||||
fn_workshop_mods "${2}"
|
fn_workshop_mods "${2}"
|
||||||
;;
|
;;
|
||||||
**)
|
**)
|
||||||
echo
|
fn_usage "$*"
|
||||||
echo -e "${red}Unknown or missing option: '${1}'${default}"
|
|
||||||
echo -e "${green}Usage: $(basename $0) [ backup | install | login | rcon [ show | reset ] | stop | update | workshop [ add id | list | remove id ] ]${default}"
|
|
||||||
echo
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
######################################
|
|
||||||
# dayzserver config file #
|
|
||||||
# the parameter have to be within "" #
|
|
||||||
# otherwise the server wont start! #
|
|
||||||
############################################################################
|
|
||||||
# https://forums.dayz.com/topic/239635-dayz-server-files-documentation/
|
|
||||||
# launch parameters documentation
|
|
||||||
#############################################################################
|
|
||||||
|
|
||||||
# DayZ SteamID
|
|
||||||
appid=1042420
|
|
||||||
dayz_id=221100
|
|
||||||
#stable=223350
|
|
||||||
#exp_branch=1042420
|
|
||||||
|
|
||||||
# IMPORTANT PARAMETERS - DO NOT REMOVE!
|
|
||||||
config=serverDZ.cfg
|
|
||||||
port=2302
|
|
||||||
|
|
||||||
# DayZ Mods from Steam Workshop
|
|
||||||
# to enable mods, remove the # below and list the Mods like this: "-mod=@Mod1;@Mod2;@Mod3"
|
|
||||||
#workshop="-mod="
|
|
||||||
|
|
||||||
# optional - just remove the # to enable
|
|
||||||
BEpath="-BEpath=${HOME}/serverfiles/battleye/"
|
|
||||||
profiles="-profiles=${HOME}/serverprofile/"
|
|
||||||
#logs="-dologs -adminlog -netlog"
|
|
||||||
|
|
||||||
# modify carefully! server won't start if syntax is corrupt!
|
|
||||||
dayzparameter=" -config=${config} -port=${port} -freezecheck ${BEpath} ${profiles} ${logs}"
|
|
|
@ -36,19 +36,17 @@ motdInterval = 1; // Time interval (in seconds) between each message
|
||||||
maxPing= 200; // Max ping value until server kick the user (value in milliseconds)
|
maxPing= 200; // Max ping value until server kick the user (value in milliseconds)
|
||||||
|
|
||||||
timeStampFormat = "Short"; // Format for timestamps in the .rpt file (value Full/Short)
|
timeStampFormat = "Short"; // Format for timestamps in the .rpt file (value Full/Short)
|
||||||
logAverageFps = 1; // Logs the average server FPS (value in seconds), needs to have -dologs launch parameter active
|
logAverageFps = 30; // Logs the average server FPS (value in seconds), needs to have -dologs launch parameter active
|
||||||
logMemory = 1; // Logs the server memory usage (value in seconds), needs to have the -dologs launch parameter active
|
logMemory = 30; // Logs the server memory usage (value in seconds), needs to have the -dologs launch parameter active
|
||||||
logPlayers = 1; // Logs the count of currently connected players (value in seconds), needs to have the -dologs launch parameter active
|
logPlayers = 30; // Logs the count of currently connected players (value in seconds), needs to have the -dologs launch parameter active
|
||||||
logFile = "server_console.log";// Saves the server console log to a file in the folder with the other server logs
|
logFile = "server_console.log";// Saves the server console log to a file in the folder with the other server logs
|
||||||
|
|
||||||
|
|
||||||
adminLogPlayerHitsOnly = 0; // 1 - log player hits only / 0 - log all hits ( animals/infected )
|
adminLogPlayerHitsOnly = 0; // 1 - log player hits only / 0 - log all hits ( animals/infected )
|
||||||
adminLogPlacement = 0; // 1 - log placement action ( traps, tents )
|
adminLogPlacement = 0; // 1 - log placement action ( traps, tents )
|
||||||
adminLogBuildActions = 0; // 1 - log basebuilding actions ( build, dismantle, destroy )
|
adminLogBuildActions = 0; // 1 - log basebuilding actions ( build, dismantle, destroy )
|
||||||
adminLogPlayerList = 0; // 1 - log periodic player list with position every 5 minutes
|
adminLogPlayerList = 0; // 1 - log periodic player list with position every 5 minutes
|
||||||
|
|
||||||
enableDebugMonitor = 1; // shows info about the character using a debug window in a corner of the screen (value 0-1)
|
enableDebugMonitor = 0; // shows info about the character using a debug window in a corner of the screen (value 0-1)
|
||||||
|
|
||||||
|
|
||||||
steamQueryPort = 2305; // defines Steam query port, should fix the issue with server not being visible in client server browser
|
steamQueryPort = 2305; // defines Steam query port, should fix the issue with server not being visible in client server browser
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue