diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index 80b1d460b..b9be9386a 100644 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -6,7 +6,7 @@ # Can check a file or directory recursively. echo "=================================" -echo "LDD Requirements Checker" +echo "Shared Object dependencies Checker" echo "=================================" if [ -z "${filesdir}" ]; then @@ -22,10 +22,32 @@ elif [ -f "${filesdir}" ]; then fi echo "" +files=$(find ${filesdir} | wc -l) find ${filesdir} -type f -print0 | while IFS= read -r -d $'\0' line; do - ldd $line |grep "=>" >>"${lgsmdir}/tmp/detect_ldd.tmp" + #ldd -v $line 2>/dev/null|grep "=>" >>"${lgsmdir}/tmp/detect_ldd.tmp" + if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable")" ]; then + echo "$line" >> "${lgsmdir}/tmp/detect_ldd.tmp" + ldd $line 2>/dev/null |grep -v "not a dynamic executable" >> "${lgsmdir}/tmp/detect_ldd.tmp" + + if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found")" ]; then + echo "$line" >> "${lgsmdir}/tmp/detect_ldd_not_found.tmp" + ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found" >> "${lgsmdir}/tmp/detect_ldd_not_found.tmp" + fi + fi + echo -n "$i / $files" $'\r' + ((i++)) done +echo "" +echo "" +echo "All" +echo "=================================" +cat "${lgsmdir}/tmp/detect_ldd.tmp" + +echo "" +echo "Not Found" +echo "=================================" +cat "${lgsmdir}/tmp/detect_ldd_not_found.tmp" -cat "${lgsmdir}/tmp/detect_ldd.tmp"|sort|uniq|sort -r --version-sort -rm "${lgsmdir}/tmp/detect_ldd.tmp" \ No newline at end of file +rm "${lgsmdir}/tmp/detect_ldd.tmp" +rm "${lgsmdir}/tmp/detect_ldd_not_found.tmp" \ No newline at end of file