Browse Source
detect-glibc will recursively check every file in $filesdir and detect the versions of GLIBC that are required. This will make is easy to detect what version of GLIBC a server requries.pull/990/head
3 changed files with 49 additions and 0 deletions
@ -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" |
Loading…
Reference in new issue