From 6dcce1d5ab89ebb29dd60481b0da5dd56bee5115 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 15 Apr 2015 17:15:10 +0200 Subject: add xcheckrestart --- xcheckrestart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 xcheckrestart (limited to 'xcheckrestart') 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 -- cgit 1.4.1