ldconfig (393B)
1 #!/bin/sh 2 scan_dirs() { 3 scanelf -qS "$@" | while read SONAME FILE; do 4 TARGET="${FILE##*/}" 5 LINK="${FILE%/*}/$SONAME" 6 case "$FILE" in 7 /lib/*|/usr/lib/*|/usr/local/lib/*) ;; 8 *) [ -h "$LINK" -o ! -e "$LINK" ] && ln -sf "$TARGET" "$LINK" 9 esac 10 done 11 return 0 12 } 13 # eat ldconfig options 14 while getopts "nNvXvf:C:r:" opt; do 15 : 16 done 17 shift $(( $OPTIND - 1 )) 18 [ $# -gt 0 ] && scan_dirs "$@"