File: checklinuxprocfs.sh

package info (click to toggle)
gps 1.1.0.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,212 kB
  • ctags: 987
  • sloc: cpp: 11,600; sh: 381; makefile: 319; ansic: 227; perl: 17
file content (38 lines) | stat: -rwxr-xr-x 479 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
#!/bin/sh
# (C) 1999 Felipe Bergo <bergo@seul.org>
# tests for Linux and /proc fs

# assure this is Linux before running this! configure.in does so.

PROCRESULT=0

# check /proc

echo -n "checking for Linux /proc fs... "

J="ab"

if [ -d /proc ]; then
 J="d!"
fi

if [ -d /proc/1 ]; then
 J="ir$J"
fi

if [ -r /proc/1/stat ]; then
 J="we$J"
fi

if [ $J = "weird!" ]; then
 echo "yes"
 PROCRESULT=1
else
 echo "no"
fi

if [ $PROCRESULT = 1 ]; then
    exit 0;
else
    exit 2;
fi