File: checkpipedtop.sh

package info (click to toggle)
gps 0.9.4-1.woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 964 kB
  • ctags: 928
  • sloc: cpp: 10,822; sh: 381; makefile: 307; ansic: 227; perl: 17
file content (43 lines) | stat: -rwxr-xr-x 745 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
# (C)1999 Felipe Bergo <bergo@seul.org>
# tests for top

echo -n "checking for top... "

QNAME="no"

if [ -x which ] ; then
 QNAME=`which top`
else
 if [ -x /sbin/top ] ; then
    QNAME=/sbin/top
 fi
 if [ -x /usr/sbin/top ] ; then
    QNAME=/usr/sbin/top
 fi
 if [ -x /usr/bin/top ] ; then
    QNAME=/usr/bin/top
 fi
 if [ -x /bin/top ] ; then
    QNAME=/bin/top
 fi
 if [ -x /usr/local/bin/top ] ; then
    QNAME=/usr/local/bin/top
 fi
fi

echo $QNAME

if [ "$QNAME" = "no" ] ; then
    exit 2
else
    echo -n "checking if local top works like William LeFebvre's top... "
    FULLBLOWN="$QNAME -b -d1 all -S"
    ($FULLBLOWN >/dev/null 2>/dev/null)
    if test $? -eq 0 ; then
	echo "yes"
	exit 0
    fi
    echo "no"
    exit 2
fi