dynamic-motd/cron-scripts/services-need-restart

12 lines
413 B
Bash
Executable File

#!/bin/bash
. /etc/update-motd.d/colors
if [[ -x /usr/sbin/checkrestart ]]; then
n=$(/usr/sbin/checkrestart -p | grep "Found .* processes using old versions of upgraded files")
echo ${n} > /var/cache/motd-service-using-old-lib
elif [[ -x /usr/sbin/needrestart ]]; then
n=$(/usr/sbin/needrestart -l -v -n -r l 2>/dev/null | grep -c "Skipping")
echo ${n} > /var/cache/motd-service-need-restart
fi