Change serveradmin.xml to be back in Saves dir
This commit is contained in:
parent
a77535a1d1
commit
18088bbafd
@ -152,6 +152,17 @@ important() {
|
|||||||
echo_rgb "${1}" 135 195 255
|
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() {
|
start_server() {
|
||||||
local server_id
|
local server_id
|
||||||
local can_kill
|
local can_kill
|
||||||
@ -250,10 +261,6 @@ start_server() {
|
|||||||
# Override UserDataFolder, opiniated in that it should exist in the Server Directory
|
# Override UserDataFolder, opiniated in that it should exist in the Server Directory
|
||||||
elif [[ "${REPLY}" = *"property name=\"UserDataFolder\""* ]]; then
|
elif [[ "${REPLY}" = *"property name=\"UserDataFolder\""* ]]; then
|
||||||
printf "\t%s\n" "<property name=\"UserDataFolder\" value=\"${server_userdata_dir}\" />"
|
printf "\t%s\n" "<property name=\"UserDataFolder\" value=\"${server_userdata_dir}\" />"
|
||||||
# This is a path RELATIVE to the save game folder, hence we overwrite ../ so it's in the
|
|
||||||
# base of the server directory
|
|
||||||
elif [[ "${REPLY}" = *"property name=\"AdminFileName\""* ]]; then
|
|
||||||
printf "\t%s\n" "<property name=\"AdminFileName\" value=\"../serveradmin.xml\" />"
|
|
||||||
# Manage the telnet tags
|
# Manage the telnet tags
|
||||||
elif [[ "${REPLY}" = *"property name=\"TelnetPort\""* ]]; then
|
elif [[ "${REPLY}" = *"property name=\"TelnetPort\""* ]]; then
|
||||||
printf "\t%s\n" "<property name=\"TelnetPort\" value=\"${telnet_port}\" />"
|
printf "\t%s\n" "<property name=\"TelnetPort\" value=\"${telnet_port}\" />"
|
||||||
@ -273,13 +280,11 @@ start_server() {
|
|||||||
|
|
||||||
# xmllint, helps avoiding the random server launch failures for apparently no reason
|
# xmllint, helps avoiding the random server launch failures for apparently no reason
|
||||||
if which xmllint >/dev/null 2>&1; then
|
if which xmllint >/dev/null 2>&1; then
|
||||||
for xml_file in "${server_directory}"/*.xml; do
|
if ! xml_lint_dir "${server_directory}"; then
|
||||||
log "info" "Linting $(important "${xml_file}")"
|
return 1
|
||||||
if ! xmllint "${xml_file}" > /dev/null; then
|
elif ! xml_lint_dir "${server_directory}/Saves/"; then
|
||||||
log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again"
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
else
|
else
|
||||||
log "warning" "$(important "xmllint") not installed or not in PATH, skipping lint check"
|
log "warning" "$(important "xmllint") not installed or not in PATH, skipping lint check"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user