if [ $# -ne 1 ]; then echo Error, uso: $0 '<'digito'>''<'digito2'>' exit fi par1=$1 if [ ${#par1} -ne 2 ]; then echo Error: se requieren de dos digitos exit fi r1=$1 p1=`expr substr $par1 1 1` case $p1 in [0-9] | [a-e] ) ;; * ) echo incorrecto exit ;; esac p2=`expr substr $par1 2 1` case $p2 in [0-9] | [a-e] ) ;; * ) echo incorrecto exit ;; esac echo Script de configuracion direccion MAC echo echo Dando de baja la interfaz eth0 echo Asignando direccion MAC 00:0C:29:A9:02:$1 echo ifconfig eth0 down hw ether 00:0C:29:A9:02:$1 exit ifconfig eth0 down hw ether 00:0C:20:A9:02:$1 sleep 1 echo Dando de alta la interfaz eth0 echo ifconfig eth0 up ifconfig eth0 up sleep 1 echo Obteniendo una direccion IP echo dhclient dhclient sleep 1 echo Verificando direcciones asignadas: ifconfig