diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-04-15 17:15:10 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-04-15 17:15:10 +0200 |
commit | 6dcce1d5ab89ebb29dd60481b0da5dd56bee5115 (patch) | |
tree | 9d41bd29c057540c6582faaa0333d835e41dd9ca | |
parent | 4d2f25c374947b21b142f244668a5aad2e600ccc (diff) | |
download | xtools-0.21.tar.gz xtools-0.21.tar.xz xtools-0.21.zip |
add xcheckrestart v0.21
-rwxr-xr-x | xcheckrestart | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xcheckrestart b/xcheckrestart new file mode 100755 index 0000000..aa3b138 --- /dev/null +++ b/xcheckrestart @@ -0,0 +1,19 @@ +#!/bin/sh +# xcheckrestart [-v] - list programs using outdated libraries + +verbose=false +[ "$1" = -v ] && verbose=true + +for f in /proc/[0-9]*; do + LIBS=$(grep -Po ' *\K .* \(deleted\)$' $f/maps 2>/dev/null | + grep -v -e /SYSV -e /.cache/fontconfig -e 'drm mm object' | + sort -u ) + if [ "$LIBS" ]; then + EXE=$(readlink $f/exe) + PKG=$(xbps-query -o "${EXE% (deleted)}") + PKG=${PKG%%:*} + PKG=${PKG%-*} + printf '%d %s (%s)\n' ${f#/proc/} "$EXE" "$PKG" + $verbose && printf '%s\n' "$LIBS" + fi +done |