2009-11-06 08:34:19 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
2009-11-08 05:25:39 +05:30
|
|
|
exec >/dev/null
|
|
|
|
exec 2>&1
|
|
|
|
exec </dev/null
|
|
|
|
|
2009-11-06 08:34:19 +05:30
|
|
|
# Since per-process /proc/net/ (-> /proc/self/net/) appeared,
|
|
|
|
# we need to be root
|
2009-11-08 05:25:39 +05:30
|
|
|
user="root"
|
2009-11-06 08:34:19 +05:30
|
|
|
tty="/dev/tty9"
|
|
|
|
cmd="nmeter '%t %c x %x p%p f %f b %b m %m if%[nif]'"
|
|
|
|
|
2009-11-08 05:25:39 +05:30
|
|
|
chmod -R a+X . # or else env will moan
|
|
|
|
chown "$user": "$tty" # devfs made happy
|
2009-11-06 08:34:19 +05:30
|
|
|
|
|
|
|
eval exec \
|
|
|
|
env - PATH="$PATH" \
|
2009-11-08 05:25:39 +05:30
|
|
|
setuidgid "$user" \
|
2009-11-06 08:34:19 +05:30
|
|
|
<"$tty" >"$tty" 2>&1 \
|
|
|
|
$cmd
|