Add number of services that need to be restarted

This commit is contained in:
Luc Didry 2016-05-04 11:53:01 +02:00
parent 7bae3d5098
commit 02c0c1551e
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/bin/bash
. /etc/update-motd.d/colors
if [[ -x /usr/sbin/needrestart ]]; then
n=$(needrestart -l -v -n -r l 2>/dev/null | grep -c "Skipping")
if [[ $n -gt 0 ]]; then
printf $LIGHT_RED
printf " %s services need to be restarted.\n" $n
printf $NONE
printf " Use needrestart to list and restart them.\n\n"
fi
fi