Răsfoiți Sursa

new glibcfix

Daniel Gibbs 10 ani în urmă
părinte
comite
a7f5af8c85
1 a modificat fișierele cu 25 adăugiri și 43 ștergeri
  1. 25 43
      lgsm/functions/fix_glibc.sh

+ 25 - 43
lgsm/functions/fix_glibc.sh

@@ -4,58 +4,40 @@
 # Website: http://gameservermanagers.com
 lgsm_version="020116"
 
+# Description: Downloads required glibc files and applys teh glibc fix if required
+
 info_glibc.sh
 
-# Blade Symphony
-if [ "${gamename}" == "Blade Symphony" ]; then
-	:
-# Dont Starve Together
-elif [ "${gamename}" == "Don't Starve Together" ]; then
-	:
-# Double Action: Boogaloo
-elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
-	fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libm.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
 
-# Fistful of Frags
-elif [ "${gamename}" == "Fistful of Frags" ]; then
-	:
-# Garry's Mod
-elif [ "${gamename}" == "Garry's Mod" ]; then
-	:
-# Insurgency
-elif [ "${gamename}" == "Insurgency" ]; then
-	:
-elif [ "${gamename}" == "Left 4 Dead" ]; then
-	:
-# Natural Selection 2
-elif [ "${gamename}" == "Natural Selection 2" ]; then
-	:
-# NS2: Combat
-elif [ "${gamename}" == "NS2: Combat" ]; then
-	:
-# No More Room in Hell
-elif [ "${gamename}" == "No More Room in Hell" ]; then
-	:
-# ARMA 3
-elif [ "${gamename}" == "ARMA 3" ]; then
-	:
-# Just Cause 2
-elif [ "${gamename}" == "Just Cause 2" ]; then
-	:
-# Serious Sam 3: BFE
-elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
-	:
-fi
+local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "Just Cause 2" )
+for libstdc_server in "${libstdc_servers_array[@]}"
+do
+	if [ "${gamename}" == "${libstdc_server}" ]; then
+		fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libstdc++.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
+	fi	
+done
+
+local libm_servers_array=( "Double Action: Boogaloo" "Fistful of Frags" "Insurgency" "Natural Selection 2" "NS2: Combat" "No More Room in Hell" )
+for libm_server in "${libm_servers_array[@]}"
+do
+	if [ "${gamename}" == "${libm_server}" ]; then
+		fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libm.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5"
+	fi	
+done
 
 
+glibc_version="$(ldd --version | sed -n '1s/.* //p')"
 if [ "$(printf '%s\n$glibc_required\n' $glibc_version | sort -V | head -n 1)" != "${glibc_required}" ]; then
-	echo "Version $(ldd --version | sed -n '1s/.* //p') is lower than $glibc_required"
 	if [ "${glibcfix}" == "yes" ]; then 
-		echo "applied glibc fix"
-		echo "export LD_LIBRARY_PATH=:${libdir}"
+		fn_print_info_nl "Glibc fix: Using Glibc fix"
+		echo "	* glibc required: $glibc_required"
+		echo "	* glibc installed: $glibc_version"
 		export LD_LIBRARY_PATH=:"${libdir}"
 	else
-		echo "no glibc fix available you need to upgrade bro!!"
+		fn_print_warn_nl "Glibc fix: No Glibc fix available!"
+		echo "	* glibc required: $glibc_required"
+		echo "	* glibc installed: $glibc_version"
+		fn_print_infomation "The game server is unlikly to work. A distro upgrade is required"
 	fi	
 else
 	echo "GLIBC is OK no fix required"