diff --git a/lgsm/functions/command_dev_detect_detect_glibc.sh b/lgsm/functions/command_dev_detect_detect_glibc.sh new file mode 100644 index 000000000..d1b19c7d4 --- /dev/null +++ b/lgsm/functions/command_dev_detect_detect_glibc.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# command_dev_detect_glibc.sh function +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +# Description: Automatically detects the version of GLIBC that is required. +# Can check a file or directory recursively. + +echo "=================================" +echo "GLIBC Requirements Checker" +echo "=================================" + +if [ -z "${filesdir}" ]; then + dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +fi + +if [ -d "${filesdir}" ]; then + echo "Checking directory: " + echo "${filesdir}" +elif [ -f "${filesdir}" ]; then + echo "Checking file: " + echo "${filesdir}" +fi +echo "" + +find ${filesdir} -type f -print0 | +while IFS= read -r -d $'\0' line; do + objdump -T $line 2>/dev/null|grep -oP "GLIBC[^ ]+" >>"${lgsmdir}/tmp" +done + +cat "${lgsmdir}/tmp"|sort|uniq|sort -r --version-sort +rm "${lgsmdir}/tmp" \ No newline at end of file diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index ffaf31288..e1e6cbbc7 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -265,6 +265,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_dev_detect_glibc.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Fix diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index f7c566d7f..4c6514bdd 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -43,6 +43,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -103,6 +105,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -156,6 +160,8 @@ case "${getopt}" in command_install.sh;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -218,6 +224,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; fd|fastdl) command_fastdl.sh;; *) @@ -283,6 +291,8 @@ case "${getopt}" in compress_ut99_maps.sh;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" @@ -349,6 +359,8 @@ case "${getopt}" in fn_autoinstall;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; mc|map-compressor) compress_unreal2_maps.sh;; *) @@ -417,6 +429,8 @@ case "${getopt}" in compress_unreal2_maps.sh;; dd|depsdetect) command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; *) if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}"