1: #!/bin/sh
2: #
3: # elwix script for set ethernet interfaces from XML config
4: #
5: # rc.eth <iface_name>
6: #
7: # $Id: rc.eth,v 1.1 2011/07/05 23:43:00 misho Exp $
8:
9: getxml()
10: {
11: XML="work/embedtools/etc/config.xml"
12:
13: xmler -g "/elwix/interfaces/$1/$2" $XML
14: }
15:
16: ### main
17:
18: if [ -z $1 ]; then
19: echo
20: echo "Error:: Not specified interface name ..."
21: echo
22: exit 1
23: fi
24:
25: IF=`getxml $1 "if"`
26: IPADDR=`getxml $1 "ipaddr"`
27: SUBNET=`getxml $1 "subnet"`
28: MEDIA=`getxml $1 "media"`
29: MEDIAOPT=`getxml $1 "mediaopt"`
30:
31: echo ifconfig $IF inet $IPADDR/$SUBNET ${MEDIA:+media $MEDIA} ${MEDIAOPT:+mediaopt $MEDIAOPT}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>