Browse Source

This fixes an issue where the log file being parsed contains multiple instances

of the version number.  When the egrep expression returns multiple lines, the
formation of the version number around line 133 ( the tr command ) that pulls
out everything but numbers generates a (potentially) enormous string.

Reference:  http://steamcommunity.com/groups/linuxgsm/discussions/0/361798516936473435/
pull/1026/head
cedarlug 9 years ago
parent
commit
89a776d576
  1. 4
      lgsm/functions/update_ts3.sh

4
lgsm/functions/update_ts3.sh

@ -48,7 +48,7 @@ fn_update_ts3_currentbuild(){
fi fi
# Get current build from logs # Get current build from logs
currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | sort -V | tail -1)
if [ -z "${currentbuild}" ]; then if [ -z "${currentbuild}" ]; then
fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found"
fn_script_log_error "Checking for update: teamspeak.com: Current build version not found" fn_script_log_error "Checking for update: teamspeak.com: Current build version not found"
@ -194,4 +194,4 @@ else
fn_update_ts3_currentbuild fn_update_ts3_currentbuild
fn_update_ts3_availablebuild fn_update_ts3_availablebuild
fn_update_ts3_compare fn_update_ts3_compare
fi fi

Loading…
Cancel
Save