Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 3 | exec >/dev/null |
| 4 | exec 2>&1 |
| 5 | exec </dev/null |
| 6 | |
Denys Vlasenko | f5c2f72 | 2009-11-08 00:55:39 +0100 | [diff] [blame] | 7 | # Since per-process /proc/net/ (-> /proc/self/net/) appeared, |
| 8 | # we need to be root |
| 9 | user="root" |
| 10 | tty="/dev/tty9" |
| 11 | cmd="nmeter '%t %c x %x p%p f %f b %b m %m if%[nif]'" |
| 12 | |
| 13 | chmod -R a+X . # or else env will moan |
| 14 | chown "$user": "$tty" # devfs made happy |
| 15 | |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 16 | eval exec \ |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 17 | env - PATH="$PATH" \ |
Denys Vlasenko | f5c2f72 | 2009-11-08 00:55:39 +0100 | [diff] [blame] | 18 | setuidgid "$user" \ |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 19 | <"$tty" >"$tty" 2>&1 \ |
| 20 | $cmd |