#!/bin/bash

. /etc/update-motd.d/colors

n=$(apt-get -qq --just-print dist-upgrade | cut -f 2 -d " " | sort -u | wc -l)
if [[ $n -gt 0 ]]; then
    printf $LIGHT_RED
    printf "  You have %s packages waiting for upgrades." "$n"
    printf $NONE"\n\n"
fi
n=$(apt-get -qq --just-print autoremove | cut -f 2 -d " " | sort -u | wc -l)
if [[ $n -gt 0 ]]; then
    printf $YELLOW
    printf "  You have %s packages that were automatically installed and are not needed anymore." "$n"
    printf $NONE"\n\n"
fi
