fix(fctrserver): parse updated version string correctly (#4688)

This commit is contained in:
Alex Linde 2024-10-26 15:45:36 -05:00 committed by Daniel Gibbs
parent 72deed15a6
commit 3dabf33eaf
No known key found for this signature in database
GPG Key ID: 2076B128385E8C55
2 changed files with 2 additions and 2 deletions

View File

@ -1310,7 +1310,7 @@ fn_info_game_fctr() {
# get server version if installed.
local factoriobin="${executabledir}${executable:1}"
if [ -f "${factoriobin}" ]; then
serverversion="$(${factoriobin} --version | grep "Version:" | awk '{print $2}')"
serverversion="$(${factoriobin} --version | grep -m 1 "Version:" | awk '{print $2}')"
fi
}

View File

@ -20,7 +20,7 @@ fn_update_localbuild() {
# Uses executable to get local build.
if [ -d "${executabledir}" ]; then
cd "${executabledir}" || exit
localbuild=$(${executable} --version | grep "Version:" | awk '{print $2}')
localbuild=$(${executable} --version | grep -m 1 "Version:" | awk '{print $2}')
fi
if [ -z "${localbuild}" ]; then
fn_print_error "Checking local build: ${remotelocation}: missing local build info"