瀏覽代碼

check_glibc on install

check glibc will check in install if the server can run with glibc
version installed or if glibc fix will get the server to run. Should
this not be possible it will ber ecommendedto upgrade the server
Daniel Gibbs 10 年之前
父節點
當前提交
c15fea5f78
共有 1 個文件被更改,包括 23 次插入0 次删除
  1. 23 0
      lgsm/functions/check_glibc.sh

+ 23 - 0
lgsm/functions/check_glibc.sh

@@ -0,0 +1,23 @@
+#!/bin/bash
+# LGSM check_glibc.sh function
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+lgsm_version="020116"
+
+# Description: Checks if server has correct glibc or has a fix available.
+
+info_glibc.sh
+
+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
+	if [ "${glibcfix}" != "yes" ]; then 
+		fn_print_warn_nl "Glibc fix: No Glibc fix available!"
+		echo -en "\n"
+		echo "	* glibc required: $glibc_required"
+		echo "	* glibc installed: $glibc_version"
+		echo -en "\n"
+		fn_print_infomation "The game server will probably not work. A distro upgrade is required!"
+		sleep 5
+	fi
+	echo -en "\n"
+fi