From 951f9d448fa4296e6b2449a2d7de0ea0b095c83d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 13 Mar 2016 05:59:47 +0100 Subject: [PATCH 1/2] matching updater's version checking Should fix the "not installing the latest version" issue. Will test and pull if working. --- functions/install_ts3.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/functions/install_ts3.sh b/functions/install_ts3.sh index 27598ac56..71d27eec3 100644 --- a/functions/install_ts3.sh +++ b/functions/install_ts3.sh @@ -18,11 +18,8 @@ fi # Grabs all version numbers but not in correct order wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp -# Replaces dots with spaces to split up the number. e.g 3 0 12 1 is 3.0.12.1 this allows correct sorting - cat .ts3_version_numbers_unsorted.tmp | tr "." " " > .ts3_version_numbers_digit.tmp -# Sorts versions in to correct order -# merges 2 files and orders by each column in order allowing these version numbers to be sorted in order -paste .ts3_version_numbers_digit.tmp .ts3_version_numbers_unsorted.tmp | awk '{print $1,$2,$3,$4 " " $0;}'| sort -k1rn -k2rn -k3rn -k4rn | awk '{print $NF}' > .ts3_version_numbers.tmp +# Sort version numbers +cat .ts3_version_numbers_unsorted.tmp | sort -r --version-sort -o .ts3_version_numbers_sorted.tmp # Finds directory with most recent server version. while read ts3_version_number; do @@ -32,18 +29,19 @@ while read ts3_version_number; do # Break while-loop, if the latest release could be found break fi -done < .ts3_version_numbers.tmp +done < .ts3_version_numbers_sorted.tmp -# tidy up -rm -f ".ts3_version_numbers_digit.tmp" +# Tidy up rm -f ".ts3_version_numbers_unsorted.tmp" -rm -f ".ts3_version_numbers.tmp" +rm -f ".ts3_version_numbers_sorted.tmp" # Checks availablebuild info is available if [ -z "${availablebuild}" ]; then fn_printfail "Checking for update: teamspeak.com" + fn_scriptlog "Checking for update: teamspeak.com" sleep 1 fn_printfail "Checking for update: teamspeak.com: Not returning version info" + fn_scriptlog "Failure! Checking for update: teamspeak.com: Not returning version info" sleep 2 exit 1 fi From 95afe04aeab0de88c1b8de910e34c32dfa394081 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 13 Mar 2016 07:17:00 +0100 Subject: [PATCH 2/2] fix error with"UNKNOWN" value instead of digit If the server (such as TS3) doesn't required glibc, the glibc needed version is UNKNOWN. That was breaking the command as it expected an numeric value. See https://github.com/dgibbs64/linuxgsm/blob/master/functions/info_glibc.sh#L63 to understand. --- functions/command_details.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/command_details.sh b/functions/command_details.sh index 396cf487c..a37024a3b 100644 --- a/functions/command_details.sh +++ b/functions/command_details.sh @@ -145,7 +145,7 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "\e[34mUser:\t\e[0m$(whoami)" # GLIBC required - if [ -n "${glibcrequired}" ]; then + if [ -n "${glibcrequired}" ] && [ "${glibcrequired}" != "UNKNOWN" ]; then if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then if [ "${glibcfix}" == "yes" ]; then echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"