fix: check output of apt command
This commit is contained in:
parent
2cc0bf3824
commit
6c39d2800a
@ -3,7 +3,13 @@
|
||||
updates=()
|
||||
|
||||
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
|
||||
|
||||
if [[ -f /etc/redhat-release ]]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user