dynamic-motd/cron-scripts/50-services-need-restart
2020-06-30 16:08:20 +02:00

12 lines
410 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")
cat ${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")
cat ${n} > /var/cache/motd-service-need-restart
i