3 # This example script activates an interface based on the specified
6 # In the interest of keeping the KVP daemon code free of distro specific
7 # information; the kvp daemon code invokes this external script to configure
10 # The only argument to this script is the configuration file that is to
11 # be used to configure the interface.
13 # Each Distro is expected to implement this script in a distro specific
14 # fashion. For instance on Distros that ship with Network Manager enabled,
15 # this script can be based on the Network Manager APIs for configuring the
18 # This example script is based on a RHEL environment.
20 # Here is the format of the ip configuration file:
23 # IF_NAME=interface name
24 # DHCP=yes (This is optional; if yes, DHCP is configured)
28 # IPADDR_x=ipaddry (where y = x + 1)
31 # NETMASK_x=netmasky (where y = x + 1)
34 # GATEWAY_x=ipaddry (where y = x + 1)
36 # DNSx=ipaddrx (where first DNS address is tagged as DNS1 etc)
38 # IPV6 addresses will be tagged as IPV6ADDR, IPV6 gateway will be
39 # tagged as IPV6_DEFAULTGW and IPV6 NETMASK will be tagged as
42 # The host can specify multiple ipv4 and ipv6 addresses to be
43 # configured for the interface. Furthermore, the configuration
44 # needs to be persistent. A subsequent GET call on the interface
45 # is expected to return the configuration that is set via the SET
51 echo "IPV6INIT=yes" >> $1
52 echo "NM_CONTROLLED=no" >> $1
53 echo "PEERDNS=yes" >> $1
54 echo "ONBOOT=yes" >> $1
56 dhcp
=$
(grep "DHCP" $1 2>/dev
/null
)
59 echo "BOOTPROTO=dhcp" >> $1;
62 cp $1 /etc
/sysconfig
/network-scripts
/
65 interface
=$
(echo $1 |
awk -F - '{ print $2 }')
67 /sbin
/ifdown
$interface 2>/dev
/null
68 /sbin
/ifup
$interfac 2>/dev
/null