]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/dist/pc/inst/watchfd
webfs on readonly filesystem
[plan9front.git] / sys / lib / dist / pc / inst / watchfd
1 #!/bin/rc
2
3 p=`{ps | grep $1 | sed 's/[^ ]* +([^ ]+) .*/\1/' }
4 while(! ~ $#p 1) {
5         sleep 1
6         p=`{ps | grep $1 | sed 's/[^ ]* +([^ ]+) .*/\1/'}
7 }
8 p=$p(1)
9
10 baropt='-w 145,129,445,168'
11 if(~ $textinst 1)
12         baropt=-t
13
14 {
15         while(test -f /proc/$p/fd)
16                 grep '^ *'^$2^' ' /proc/$p/fd >[2]/dev/null
17 } | awk '{print $9 " '^$3^'"; fflush("/dev/stdout")}' | bargraph $baropt $4