blob: 7e51124e1de1a44e21630bdab2e7869c2d7c5a8a [file] [log] [blame]
Denys Vlasenko6cf7f012009-11-06 04:04:19 +01001#!/bin/sh
2
Denys Vlasenko6cf7f012009-11-06 04:04:19 +01003exec >/dev/null
4exec 2>&1
5exec </dev/null
6
Denys Vlasenkof5c2f722009-11-08 00:55:39 +01007# Since per-process /proc/net/ (-> /proc/self/net/) appeared,
8# we need to be root
9user="root"
10tty="/dev/tty9"
11cmd="nmeter '%t %c x %x p%p f %f b %b m %m if%[nif]'"
12
13chmod -R a+X . # or else env will moan
14chown "$user": "$tty" # devfs made happy
15
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010016eval exec \
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010017env - PATH="$PATH" \
Denys Vlasenkof5c2f722009-11-08 00:55:39 +010018setuidgid "$user" \
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010019<"$tty" >"$tty" 2>&1 \
20$cmd