From 94d0c59955176b8f92bdd0d2b2d2a366b77af357 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 24 Dec 2021 09:42:56 -0600 Subject: [PATCH] Fixed login anonymous by moving it forward in line, servers now run in a loop that will restart them on crash --- CentOS/7-Days-To-Die/7D2D-Manage.bash | 8 +++----- CentOS/7-Days-To-Die/7D2D-Serv-Handler.bash | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 CentOS/7-Days-To-Die/7D2D-Serv-Handler.bash diff --git a/CentOS/7-Days-To-Die/7D2D-Manage.bash b/CentOS/7-Days-To-Die/7D2D-Manage.bash index 24f4e55..0a10008 100644 --- a/CentOS/7-Days-To-Die/7D2D-Manage.bash +++ b/CentOS/7-Days-To-Die/7D2D-Manage.bash @@ -129,9 +129,7 @@ start_server() { fi log "info" "Creating new session for $(important "${server_name}") as session $(important "${server_session_name}")" - tmux new-session -d -s "${server_session_name}" "${server_directory}/"startserver.sh \ - -configfile="${server_directory}/"serverconfig.xml - + tmux new-session -d -s "${server_session_name}" ~/.bin/7D2D-Serv-Handler "${server_directory}" log "info" "Finished starting $(important "${server_name}") on port $(important "${server_port}") as tmux session $(important "${server_session_name}")" } @@ -234,7 +232,7 @@ install() { exit 1 log "info" "Installing $(important "${server_name}") to $(important "${server_directory}")" - steamcmd +login anonymous +force_install_dir "${server_directory}" +app_update 294420 validate +quit + steamcmd +force_install_dir "${server_directory}" +login anonymous +app_update 294420 validate +quit mkdir -p "${server_directory}/Mods" log "info" "Successfully installed $(important "${server_name}") to $(important "${server_directory}")" } @@ -293,7 +291,7 @@ update() { gzip > "${backup_full_path}" tar -czf "${server_directory}" "${backup_dir}"/ log "info" "Updating server $(important "${server_name}") located at $(important "${server_directory}")..." - steamcmd +login anonymous +force_install_dir "${server_directory}" +app_update 294420 validate +quit + steamcmd +force_install_dir "${server_directory}" +login anonymous +app_update 294420 validate +quit log "info" "Finished updating $(important "${server_name}") located at $(important "${server_directory}")" diff --git a/CentOS/7-Days-To-Die/7D2D-Serv-Handler.bash b/CentOS/7-Days-To-Die/7D2D-Serv-Handler.bash new file mode 100644 index 0000000..0f9ba5d --- /dev/null +++ b/CentOS/7-Days-To-Die/7D2D-Serv-Handler.bash @@ -0,0 +1,4 @@ +until "${1}/"startserver.sh -configfile="${1}/"serverconfig.xml; do + echo "Server died with code $?, restarting in 60 seconds..." >&2 + sleep 60; +done