#!/bin/bash # # /etc/rc.d/init.d/macaddr # # Sets the mac address for the ALIX # # chkconfig: 2345 07 99 # description: set MAC address # processname: macaddr # Source function library. . /etc/init.d/functions test -x /etc/macaddr/ || exit 0 RETVAL=0 prog="macaddr" start() { cd /etc/macaddr/ for port in * do macaddr=`cat $port` echo "Setting interface $port to hardware MAC address $macaddr" /sbin/ifdown $port /sbin/ifconfig $port hw ether $macaddr done } # # See how we were called. # case "$1" in start) start ;; stop) ;; *) echo $"Usage: $0 {start|stop}" exit 1 esac exit $RETVAL