mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 22:31:18 +00:00
See if we get fewer commit warnings.
This commit is contained in:
parent
2f1f30fd6b
commit
958c9711fe
1 changed files with 26 additions and 28 deletions
|
@ -6,48 +6,48 @@ 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.
|
||||||
port=${SERVER_PORT}
|
export port=${SERVER_PORT}
|
||||||
rcon_port=${RCON_PORT}
|
export rcon_port=${RCON_PORT}
|
||||||
|
|
||||||
# Don't change anything else.
|
# Don't change anything else.
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
default="\e[0m"
|
export default="\e[0m"
|
||||||
red="\e[31m"
|
export red="\e[31m"
|
||||||
green="\e[32m"
|
export green="\e[32m"
|
||||||
yellow="\e[93m"
|
export yellow="\e[93m"
|
||||||
lightblue="\e[94m"
|
export lightblue="\e[94m"
|
||||||
blue="\e[34m"
|
export blue="\e[34m"
|
||||||
magenta="\e[35m"
|
export magenta="\e[35m"
|
||||||
cyan="\e[36m"
|
export cyan="\e[36m"
|
||||||
|
|
||||||
# DayZ release server Steam app ID.
|
# DayZ release server Steam app ID.
|
||||||
# Now that the Linux server is released, the binaries will come from this ID.
|
# Now that the Linux server is released, the binaries will come from this ID.
|
||||||
release_server_appid=223350
|
export release_server_appid=223350
|
||||||
|
|
||||||
# Leaving the experimental server appid here to allow for the use of the experimental server.
|
# Leaving the experimental server appid here to allow for the use of the experimental server.
|
||||||
#release_server_appid=1042420
|
#export release_server_appid=1042420
|
||||||
|
|
||||||
# DayZ release client SteamID. This is for mods, as only the release client has them.
|
# DayZ release client SteamID. This is for mods, as only the release client has them.
|
||||||
release_client_appid=221100
|
export release_client_appid=221100
|
||||||
|
|
||||||
# Server container profile directory
|
# Server container profile directory
|
||||||
SERVER_PROFILE="/profiles"
|
export SERVER_PROFILE="/profiles"
|
||||||
|
|
||||||
# Common container base directories
|
# Common container base directories
|
||||||
FILES="/files"
|
export FILES="/files"
|
||||||
SERVER_FILES="/serverfiles"
|
export SERVER_FILES="/serverfiles"
|
||||||
|
|
||||||
# Used to check if dayZ is installed
|
# Used to check if dayZ is installed
|
||||||
SERVER_INSTALL_FILE="${SERVER_FILES}/DayZServer"
|
export SERVER_INSTALL_FILE="${SERVER_FILES}/DayZServer"
|
||||||
|
|
||||||
# Steam files
|
# Steam files
|
||||||
STEAM_LOGIN="${HOME}/steamlogin"
|
export STEAM_LOGIN="${HOME}/steamlogin"
|
||||||
STEAMCMD=steamcmd
|
export STEAMCMD=steamcmd
|
||||||
|
|
||||||
# Other stuff
|
# Other stuff
|
||||||
YES="${green}yes${default}"
|
export YES="${green}yes${default}"
|
||||||
NO="${red}no${default}"
|
export NO="${red}no${default}"
|
||||||
|
|
||||||
# Convenience function
|
# Convenience function
|
||||||
prompt_yn(){
|
prompt_yn(){
|
||||||
|
@ -95,7 +95,7 @@ get_mod_name(){
|
||||||
echo "Mod ID ${1} doesn't exist" >&2
|
echo "Mod ID ${1} doesn't exist" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
NAME=$(grep name ${WORKSHOP_DIR}/${1}/meta.cpp | cut -d '"' -f2 | tr -cd [:alnum:])
|
NAME=$(grep name "${WORKSHOP_DIR}/${1}/meta.cpp" | cut -d '"' -f2 | tr -cd "[:alnum:]")
|
||||||
if [[ ${NAME} = "" ]]
|
if [[ ${NAME} = "" ]]
|
||||||
then
|
then
|
||||||
echo "Could not get metadata. See above. Exiting..."
|
echo "Could not get metadata. See above. Exiting..."
|
||||||
|
@ -113,19 +113,17 @@ get_mod_id(){
|
||||||
fi
|
fi
|
||||||
# If we have a second argument, we want to iterate over active server mods
|
# If we have a second argument, we want to iterate over active server mods
|
||||||
DIR=${SERVER_FILES}
|
DIR=${SERVER_FILES}
|
||||||
ARG="-d"
|
|
||||||
if [[ ${2} = "0" ]]
|
if [[ ${2} = "0" ]]
|
||||||
then
|
then
|
||||||
ARG="-tdr"
|
|
||||||
DIR=${SERVER_PROFILE}
|
DIR=${SERVER_PROFILE}
|
||||||
fi
|
fi
|
||||||
# echo "DIR: ${DIR}, ARG: ${ARG}" >&2
|
# echo "DIR: ${DIR}, ARG: ${ARG}" >&2
|
||||||
X=1
|
X=1
|
||||||
# Loop over mods
|
# Loop over mods
|
||||||
for link in $(ls ${ARG} ${DIR}/@* 2> /dev/null)
|
for link in "${DIR}"/@*
|
||||||
do
|
do
|
||||||
ID=$(readlink ${link} | awk -F/ '{print $NF}')
|
ID=$(readlink ${link} | awk -F/ '{print $NF}')
|
||||||
if [[ ${X} = ${1} ]]
|
if [[ "${X}" = "${1}" ]]
|
||||||
then
|
then
|
||||||
echo -n ${ID}
|
echo -n ${ID}
|
||||||
return
|
return
|
||||||
|
@ -140,14 +138,14 @@ get_mods(){
|
||||||
do
|
do
|
||||||
ID=$(readlink ${link} | awk -F/ '{print $NF}')
|
ID=$(readlink ${link} | awk -F/ '{print $NF}')
|
||||||
MODNAME=$(get_mod_name ${ID})
|
MODNAME=$(get_mod_name ${ID})
|
||||||
workshoplist+=" +workshop_download_item "${release_client_appid}" "${ID}
|
workshoplist+=" +workshop_download_item ${release_client_appid} ${ID}"
|
||||||
done
|
done
|
||||||
get_mod_command_line
|
get_mod_command_line
|
||||||
}
|
}
|
||||||
|
|
||||||
get_mod_command_line(){
|
get_mod_command_line(){
|
||||||
mod_command_line=""
|
mod_command_line=""
|
||||||
for link in $(ls -tdr ${SERVER_PROFILE}/@* 2> /dev/null)
|
for link in "${SERVER_PROFILE}"/@*
|
||||||
do
|
do
|
||||||
ID=$(readlink ${link} | awk -F/ '{print $NF}')
|
ID=$(readlink ${link} | awk -F/ '{print $NF}')
|
||||||
MODNAME=$(get_mod_name ${ID})
|
MODNAME=$(get_mod_name ${ID})
|
||||||
|
|
Loading…
Add table
Reference in a new issue