#!/bin/sh
### getnetconf
### $Id: getnetconf,v 1.2 1993/05/29 18:39:46 mdw Exp $
### Matt Welsh <mdw@tc.cornell.edu>

# Some security
PATH=/bin:/usr/bin:/etc
IFS="	 "

# This is the netsetup directory
NET_DIR="/etc"
CONF_FILE=$NET_DIR/net.conf

if [ "$#" != "1" ]; then
  echo "getnetconf: usage"
  echo "  getnetconf <field>"
  echo "where <field> is the field name in $CONF_FILE."
  exit 1
fi

if [ ! -f $CONF_FILE ]; then
  echo "getnetconf: cannot read $CONF_FILE."
  exit 1
fi

grep "^$1\W" $CONF_FILE | awk '{print $2}'
