Przeglądaj źródła

matching updater's version checking

Should fix the "not installing the latest version" issue.
Will test and pull if working.
UltimateByte 10 lat temu
rodzic
commit
951f9d448f
1 zmienionych plików z 7 dodań i 9 usunięć
  1. 7 9
      functions/install_ts3.sh

+ 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