From c70e976e8883eef0d890a1963891d826ceb9639d Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 31 Dec 2021 23:56:47 -0600 Subject: [PATCH] Revert xmllint requirement --- Scripts/7D2D-Manage.bash | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Scripts/7D2D-Manage.bash b/Scripts/7D2D-Manage.bash index b1fc5c6..185752f 100644 --- a/Scripts/7D2D-Manage.bash +++ b/Scripts/7D2D-Manage.bash @@ -268,13 +268,17 @@ start_server() { mv "temp-serverconfig.xml" "${server_config}" # xmllint, helps avoiding the random server launch failures for apparently no reason - for xml_file in "${server_directory}"/*.xml; do - log "info" "Linting $(important "${xml_file}")..." - if ! xmllint "${xml_file}" > /dev/null; then - log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again" - return 1 - fi - done + if which xmllint >/dev/null 2>&1; then + for xml_file in "${server_directory}"/*.xml; do + log "info" "Linting $(important "${xml_file}")..." + if ! xmllint "${xml_file}" > /dev/null; then + log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again" + return 1 + fi + done + else + log "warning" "$(important "xmllint") not installed or not in PATH, skipping lint check" + fi log "info" "Starting $(important "${server_name}") located at $(important "${server_directory}") on game port $(important "${server_port}") and telnet port $(important "${telnet_port}")"