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