#!/bin/sh -
#
#  @(#)rotary 1.3 91/11/19
#
#  Copyright (c) Steve Kinzler - April 1991.
#
#  Permission is given to distribute these sources, as long as the
#  copyright messages are not removed, and no monies are exchanged.
#
#  No responsibility is taken for any errors on inaccuracies inherent
#  either to the comments or the code of this program, but if reported
#  to me, then an attempt will be made to fix them.

PATH=/usr/ucb:/bin:/usr/bin:/usr/local/bin; export PATH

# rotary - display current dialin rotary usage
# Steve Kinzler, kinzler@cs.indiana.edu, July 1990

# warning: lots of assumptions and dependencies here

sed '/^#/d' /usr/local/etc/dialins |
sed -n '/head rotary/,/tail rotary/p' |
awk '{ printf "echo -n %s\ ; ls -l /nfs/%s/dev/%s\n", $1, $3, $5 }' |
sh 2>&1 |
sed 's/\(.*\) \(.*\): .*/\1 . . DOWN . . . . . \2/' |
awk '{ printf "%s\t%s\t%s\n", $1, $10, $4 }' |
sed -e 's,/nfs/\(.*\)/dev/,\1:,' -e 's/	root$/	-/'
