add fallback if apt-check is not found

add support for yum (fedora)
This commit is contained in:
Dustin Kirkland 2008-12-14 22:39:19 -06:00
commit ba1461d2fc
2 changed files with 14 additions and 1 deletions

View file

@ -1,5 +1,10 @@
#!/bin/sh
if [ ! -x /usr/share/update-notifier/notify-reboot-required ]; then
echo "?"
exit 1
fi
if [ -e /var/run/reboot-required ]; then
echo "(@)"
fi

View file

@ -1,3 +1,11 @@
#!/bin/sh
/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$/\!/"
if [ -x /usr/lib/update-notifier/apt-check ]; then
/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
elif [ -x /usr/bin/yum ]; then
/usr/bin/yum list updates | grep -c "updates"
else
echo "?"
fi