فهرست منبع

150914 - Fix GLIBC fix issues

Scarsz 11 سال پیش
والد
کامیت
c832ed84c8
1فایلهای تغییر یافته به همراه23 افزوده شده و 12 حذف شده
  1. 23 12
      GarrysMod/gmodserver

+ 23 - 12
GarrysMod/gmodserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Server Management Script
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
 # Website: http://danielgibbs.co.uk
-# Version: 100914
+# Version: 150914
 
 
 #### Variables ####
 #### Variables ####
 
 
@@ -672,16 +672,27 @@ cd "${filesdir}"
 cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}"
 cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}"
 sleep 1
 sleep 1
 echo ""
 echo ""
-####### Temporarily disabled for testing, for info see 
-####### https://github.com/dgibbs64/linuxgameservers/issues/154
-#echo "Applying GLIBC_2.15 fix"
-#echo "================================="
-#sleep 1
-#cd "${filesdir}"/bin
-#wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
-#wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
-#wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
-#echo ""
+if [ -z $(command -v ldd) ]; then
+	echo "GLIBC is not installed."
+	echo "Downloading required files for GLIBC"
+	echo "================================="
+	sleep 1
+	cd "${filesdir}"/bin
+	wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
+	wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
+	wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
+	echo ""
+elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
+	echo "Outdated GLIBC version '$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)'"
+	echo "Downloading updated files"
+	echo "================================="
+	sleep 1
+	cd "${filesdir}"/bin
+	wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
+	wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
+	wget -nv https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
+	echo ""
+fi
 }
 }
 
 
 fn_header(){
 fn_header(){
@@ -959,4 +970,4 @@ case "$1" in
 	echo "Usage: $0 {start|stop|restart|update|update-restart|validate|validate-restart|monitor|email-test|details|backup|console|debug|install}"
 	echo "Usage: $0 {start|stop|restart|update|update-restart|validate|validate-restart|monitor|email-test|details|backup|console|debug|install}"
 	exit 1;;
 	exit 1;;
 esac
 esac
-exit
+exit