浏览代码

Merge pull request #755 from dgibbs64/ts3-install-version

matching updater's version checking & fix details
Daniel Gibbs 10 年之前
父节点
当前提交
2f57e06699
共有 2 个文件被更改,包括 8 次插入10 次删除
  1. 1 1
      functions/command_details.sh
  2. 7 9
      functions/install_ts3.sh

+ 1 - 1
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)"

+ 7 - 9
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 href=\".*\/\">.*\/<\/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