Fixed login anonymous by moving it forward in line, servers now run in a loop that will restart them on crash

This commit is contained in:
Price Hiller 2021-12-24 09:42:56 -06:00
parent 8d948d7af6
commit 94d0c59955
2 changed files with 7 additions and 5 deletions

View File

@ -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}")"

View File

@ -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