Created
August 9, 2016 20:27
-
-
Save dgibbs64/c8703d3c1509e09433134d1cadccbf0d to your computer and use it in GitHub Desktop.
check_glibc_requirement.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# check_glibc_requirements.sh function | |
# Author: Daniel Gibbs | |
# Website: https://danielgibbs.co.uk | |
# Description: Automatically detects the version of GLIBC that is required. | |
# Can check a file or directory recursively | |
# Usage check_glibc_requirements.sh [dir] | |
echo "=================================" | |
echo "GLIBC Requirements Checker" | |
echo "=================================" | |
dir="$1" | |
if [ -z "${dir}" ]; then | |
dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" | |
fi | |
if [ -d "${dir}" ]; then | |
echo "Checking directory: " | |
echo "${dir}" | |
elif [ -f "${dir}" ]; then | |
echo "Checking file: " | |
echo "${dir}" | |
fi | |
echo "" | |
find ${dir} -type f -print0 | | |
while IFS= read -r -d $'\0' line; do | |
objdump -T $line 2>/dev/null|grep -oP "GLIBC[^ ]+" >>/tmp/glibcdump | |
done | |
cat /tmp/glibcdump|sort|uniq|sort -r --version-sort | |
rm /tmp/glibcdump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rough script but works