about summary refs log tree commit diff
path: root/xcheckrestart
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-04-15 17:15:10 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-04-15 17:15:10 +0200
commit6dcce1d5ab89ebb29dd60481b0da5dd56bee5115 (patch)
tree9d41bd29c057540c6582faaa0333d835e41dd9ca /xcheckrestart
parent4d2f25c374947b21b142f244668a5aad2e600ccc (diff)
downloadxtools-6dcce1d5ab89ebb29dd60481b0da5dd56bee5115.tar.gz
xtools-6dcce1d5ab89ebb29dd60481b0da5dd56bee5115.tar.xz
xtools-6dcce1d5ab89ebb29dd60481b0da5dd56bee5115.zip
add xcheckrestart v0.21
Diffstat (limited to 'xcheckrestart')
-rwxr-xr-xxcheckrestart19
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