mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 05:53:22 -07:00
print empty string when no updates available, Bug #308215
This commit is contained in:
parent
18949575ad
commit
a11f92b4dd
1 changed files with 12 additions and 3 deletions
|
@ -1,11 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
u=
|
||||
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
||||
/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$/\!/"
|
||||
u=`/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$//"`
|
||||
elif [ -x /usr/bin/apt-get ]; then
|
||||
/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep ^Inst | wc -l | sed "s/$/\!/"
|
||||
u=`/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst`
|
||||
elif [ -x /usr/bin/yum ]; then
|
||||
/usr/bin/yum list updates | grep -c "updates" | sed "s/$/\!/"
|
||||
u=`/usr/bin/yum list updates | grep -c "updates"`
|
||||
else
|
||||
echo "?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$u" = "0" ]; then
|
||||
echo ""
|
||||
else
|
||||
echo "$u!"
|
||||
fi
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue