fix: check output of apt command

This commit is contained in:
Jeffrey Serio 2025-01-22 21:39:26 -06:00
parent 2cc0bf3824
commit 6c39d2800a

View File

@ -3,7 +3,13 @@
updates=() updates=()
if [[ -f /etc/debian_version ]]; then if [[ -f /etc/debian_version ]]; then
updates+=("[ APT: $(sudo apt update 2>/dev/null | grep packages | cut -d '.' -f 1 | awk '{print $1}') ]") APT_UPDATES=$(sudo apt update 2>/dev/null | grep packages | cut -d '.' -f 1 | awk '{print $1}')
if [ "$APT_UPDATES" = "All" ]; then
NUM_UPDATES=0
else
NUM_UPDATES="$APT_UPDATES"
fi
updates+=("[ APT: ${NUM_UPDATES} ]")
fi fi
if [[ -f /etc/redhat-release ]]; then if [[ -f /etc/redhat-release ]]; then