#!/usr/bin/env bash set -eEa # If you want/need the server and rcon ports to be different, set them here. # The steam query port is set in serverDZ.cfg. # Server port port=2302 rcon_port=2303 # Don't change anything else. # Colors default="\e[0m" red="\e[31m" green="\e[32m" yellow="\e[93m" lightblue="\e[94m" blue="\e[34m" magenta="\e[35m" cyan="\e[36m" # DayZ release server Steam app ID. USE ONE OR THE OTHER!! # Presumably once the Linux server is released, the binaries will come from this ID. # But more importantly, if we have a release-compatible binary, the base files must be installed from this id, # even if the server binary and accompanying shared object don't come from it. #release_server_appid=223350 # Without a release binary, we must use the experimental server app id for everything. release_server_appid=1042420 # DayZ release client SteamID. This is for mods, as only the release client has them. release_client_appid=221100 # Common container base directories FILES="/files" SERVER_FILES="/serverfiles" # Used to check if dayZ is installed SERVER_INSTALL_FILE="${SERVER_FILES}/DayZServer" # Steam files STEAM_LOGIN="${HOME}/steamlogin" STEAMCMD=steamcmd # Other stuff YES="${green}yes${default}" NO="${red}no${default}" # Convenience function prompt_yn(){ echo -n "${1} (y|N) " >&2 read -s -n 1 a a=$(echo ${a} | tr A-Z a-z) echo if [[ "${a}" = "y" ]] then return 0 else return 1 fi } # List mods list(){ X=1 C="${green}" spaces=" " echo "Installed mods:" echo -e " ID Name URL Size" echo "------------------------------------------------------------------------------------------------------------------------" for dir in $(ls -tr ${WORKSHOP_DIR}) do ID=${dir} NAME=$(grep name "${WORKSHOP_DIR}/${dir}/meta.cpp" | cut -d '"' -f2 | sed -r 's/\s+//g') SIZE=$(du -sh "${WORKSHOP_DIR}/${dir}" | awk '{print $1}') printf "${C}%.3d %s %.30s %s https://steamcommunity.com/sharedfiles/filedetails/?id=%s %s${default}\n" ${X} ${ID} "${NAME}" "${spaces:${#NAME}+1}" ${ID} ${SIZE} X=$((X+1)) done echo }