Skip to content

Commit

Permalink
Update openssl-check.sh
Browse files Browse the repository at this point in the history
Cleaned up code, added some error checking
  • Loading branch information
omkhar authored Oct 29, 2022
1 parent 4306bca commit ad8ee4f
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions openssl-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@
# License GPL
# Copyright 2022 Omkhar Arasaratnam

for FILE in `find / -type f -executable -print`
if [ ${UID} -ne 0 ]
then
echo "Not running as root, we may not be able to read all binaries on the system [enter to continue]"
read
fi

LDD=`which ldd`
EXIT=$?
if [ ${EXIT} -ne 0 ]
then
echo "Couldn't find ldd, exiting"
exit 1
fi

FIND=`which find`
EXIT=$?
if [ ${EXIT} -ne 0 ]
then
echo "Couldn't find find, exiting"
exit 1
fi

for FILE in `${FIND} / -type f -executable -print`
do
SSL=""
SSL=`ldd ${FILE} 2> /dev/null | grep -i libssl.so.3`
${LDD} ${FILE} 2> /dev/null | grep -i "libssl.so.3" &> /dev/null
EXIT=$?
if [ ${EXIT} -eq 0 ]
then
Expand Down

0 comments on commit ad8ee4f

Please sign in to comment.