mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
support /var/run/updates-available cache available in jaunty
report cpu speed in GHz if we have a calculator
This commit is contained in:
parent
1f806d2c1e
commit
c0f85755bb
3 changed files with 40 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$/ MHz/"
|
||||
mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$//"`
|
||||
if [ $mhz -gt 1000 -a -x /usr/bin/bc ]; then
|
||||
ghz=$(echo "scale=1; $mhz/1000" | bc)
|
||||
echo "$ghz GHz"
|
||||
else
|
||||
echo "$mhz MHz"
|
||||
fi
|
||||
|
|
|
@ -1,20 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
print_updates() {
|
||||
u=$1
|
||||
if [ "$u" = "0" ]; then
|
||||
echo ""
|
||||
else
|
||||
echo "$u!"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
cache=/var/run/updates-available
|
||||
u=
|
||||
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
||||
u=`/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$//"`
|
||||
elif [ -x /usr/bin/apt-get ]; then
|
||||
u=`/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst`
|
||||
elif [ -x /usr/bin/yum ]; then
|
||||
u=`/usr/bin/yum list updates | grep -c "updates"`
|
||||
else
|
||||
echo "?"
|
||||
exit 1
|
||||
# If global updates-available cache is present, use it. Available as of jaunty.
|
||||
if [ -r $cache ]; then
|
||||
u=`grep -m 1 "^[0-9]" $cache | sed "s/\s.*$//"`
|
||||
print_updates $u
|
||||
fi
|
||||
|
||||
if [ "$u" = "0" ]; then
|
||||
echo ""
|
||||
else
|
||||
echo "$u!"
|
||||
# If apt-check binary exists, use it
|
||||
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
||||
u=`/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$//"`
|
||||
print_updates $u
|
||||
fi
|
||||
exit 0
|
||||
|
||||
# If apt-get exists, use it
|
||||
if [ -x /usr/bin/apt-get ]; then
|
||||
u=`/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst`
|
||||
fi
|
||||
|
||||
# If yum exists, use it
|
||||
if [ -x /usr/bin/yum ]; then
|
||||
u=`/usr/bin/yum list updates | grep -c "updates"`
|
||||
fi
|
||||
|
||||
# If we're here, we have no idea
|
||||
print_updates "?"
|
||||
|
|
1
debian/control
vendored
1
debian/control
vendored
|
@ -11,6 +11,7 @@ Package: screen-profiles
|
|||
Architecture: all
|
||||
Depends: debconf (>= 0.5) | debconf-2.0, screen, gettext-base, debianutils
|
||||
Recommends: update-notifier-common
|
||||
Suggests: bc
|
||||
Description: a set of useful profiles and a profile-switcher for GNU screen
|
||||
screen-profiles includes a set of profiles for the GNU screen window manager.
|
||||
These profiles are quite useful on server machines which are not running
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue