Script for copy libraries from executable

This commit is contained in:
q3aql 2024-07-07 16:18:40 +02:00
parent 63eb9b5c56
commit b5f647656a

17
packelf-copylibs.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env sh
if [ -z "${1}" ] ; then
echo "$0 <path-elf> <path-to-copy-libraries>"
exit 0
else
if [ -z "${2}" ] ; then
echo "$0 <path-elf> <path-to-copy-libraries>"
exit 0
else
libs="$(ldd "${1}" | grep -F '/' | sed -E 's|[^/]*/([^ ]+).*?|/\1|')"
for library in ${libs} ; do
cp -L ${library} ${2}
echo "Copied ${library} to ${2}"
done
fi
fi