diff --git a/Scripts/7D2D-Manage.bash b/Scripts/7D2D-Manage.bash index 0b78ef8..eb15f1a 100644 --- a/Scripts/7D2D-Manage.bash +++ b/Scripts/7D2D-Manage.bash @@ -152,17 +152,6 @@ important() { echo_rgb "${1}" 135 195 255 } -xml_lint_dir() { - - for xml_file in "${1}"/*.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 - -} start_server() { local server_id local can_kill @@ -280,11 +269,13 @@ start_server() { # xmllint, helps avoiding the random server launch failures for apparently no reason if which xmllint >/dev/null 2>&1; then - if ! xml_lint_dir "${server_directory}"; then - return 1 - elif ! xml_lint_dir "${server_directory}/Saves/"; then - return 1 - fi + for xml_file in "${server_directory}"/{*,"Saves"}.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