snippets/update.motd/60-upgrades

13 lines
351 B
Plaintext
Raw Normal View History

2024-04-16 11:44:31 +02:00
#!/bin/sh
printf "\n"
number=`apt list --upgradable 2> /dev/null | grep 'upgradable' | wc -l`
printf "Available updates : %s\n" $number
if [ $number -gt 0 ]; then
printf "\033[1;31mSystem needs %s updates\033[0m\n" $number
apt list --upgradable 2> /dev/null | grep 'upgradable'
else
printf "\033[1;32mSystem is uptodate\033[0m\n"
fi
echo