#!/bin/sh #ident "$Id: hmendd,v 1.5 1999/07/04 00:55:56 sjk Exp $" #ident "$Source: /opt/local/src/sysadm/fs-config/etc/init.d/RCS/hmendd,v $" # # Hardwire hme port speed/duplex # config=/etc/opt/hmendd.conf # configuration parameters if [ -f $config ]; then . $config else echo "$0: $config missing -- exiting" >&2 exit 1 fi case "$1" in 'start') # Loop through all hme interfaces for tuple in `echo $hmelist | sed 's/,/ /g'`; do # Extract instance instance=`echo $tuple | awk -F: '{print $1}` # Set positional flags config=`echo $tuple | awk -F: ' $2=="100full" {print "1 0 0 0"} $2=="100half" {print "0 1 0 0"} $2=="10full" {print "0 0 1 0"} $2=="10half" {print "0 0 0 1"}'` if [ -z "$config" ]; then echo "Unable to parse $tuple or $hmelist" >&2 break fi set $config # Config instance ndd -set /dev/hme instance $instance ndd -set /dev/hme adv_100T4_cap 0 ndd -set /dev/hme adv_100fdx_cap $1 ndd -set /dev/hme adv_100hdx_cap $2 ndd -set /dev/hme adv_10fdx_cap $3 ndd -set /dev/hme adv_10hdx_cap $4 ndd -set /dev/hme adv_autoneg_cap 0 done ;; 'stop') ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0