Ver Fonte

fix(fctrserver): resolve factorio update bug

Jonathan Rosewood há 7 anos atrás
pai
commit
a98b5fdd4b
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      lgsm/functions/update_factorio.sh

+ 3 - 3
lgsm/functions/update_factorio.sh

@@ -81,10 +81,10 @@ fn_update_factorio_arch(){
 
 fn_update_factorio_availablebuild(){
 	# Gets latest build info.
-	if [ "${branch}" != "stable" ]; then
-		availablebuild=$(${curlpath} -s https://factorio.com/get-download/stable/headless/linux64 | grep -o '[0-9]\.[0-9]\{2\}\.[0-9]\{2\}' | head -1)
+	if [ "${branch}" == "stable" ]; then
+		availablebuild=$(${curlpath} -s https://factorio.com/get-download/stable/headless/linux64 | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1)
 	else
-		availablebuild=$(${curlpath} -s https://factorio.com/get-download/latest/headless/linux64 | grep -o '[0-9]\.[0-9]\{2\}\.[0-9]\{2\}' | head -1)
+		availablebuild=$(${curlpath} -s https://factorio.com/get-download/latest/headless/linux64 | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1)
 	fi
 	# Checks if availablebuild variable has been set
 	if [ -z "${availablebuild}" ]; then