Root/
1 | #!/bin/bash |
2 | |
3 | # This example script activates an interface based on the specified |
4 | # configuration. |
5 | # |
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 |
8 | # the interface. |
9 | # |
10 | # The only argument to this script is the configuration file that is to |
11 | # be used to configure the interface. |
12 | # |
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 |
16 | # interface. |
17 | # |
18 | # This example script is based on a RHEL environment. |
19 | # |
20 | # Here is the format of the ip configuration file: |
21 | # |
22 | # HWADDR=macaddr |
23 | # DEVICE=interface name |
24 | # BOOTPROTO=<protocol> (where <protocol> is "dhcp" if DHCP is configured |
25 | # or "none" if no boot-time protocol should be used) |
26 | # |
27 | # IPADDR0=ipaddr1 |
28 | # IPADDR1=ipaddr2 |
29 | # IPADDRx=ipaddry (where y = x + 1) |
30 | # |
31 | # NETMASK0=netmask1 |
32 | # NETMASKx=netmasky (where y = x + 1) |
33 | # |
34 | # GATEWAY=ipaddr1 |
35 | # GATEWAYx=ipaddry (where y = x + 1) |
36 | # |
37 | # DNSx=ipaddrx (where first DNS address is tagged as DNS1 etc) |
38 | # |
39 | # IPV6 addresses will be tagged as IPV6ADDR, IPV6 gateway will be |
40 | # tagged as IPV6_DEFAULTGW and IPV6 NETMASK will be tagged as |
41 | # IPV6NETMASK. |
42 | # |
43 | # The host can specify multiple ipv4 and ipv6 addresses to be |
44 | # configured for the interface. Furthermore, the configuration |
45 | # needs to be persistent. A subsequent GET call on the interface |
46 | # is expected to return the configuration that is set via the SET |
47 | # call. |
48 | # |
49 | |
50 | |
51 | |
52 | echo "IPV6INIT=yes" >> $1 |
53 | echo "NM_CONTROLLED=no" >> $1 |
54 | echo "PEERDNS=yes" >> $1 |
55 | echo "ONBOOT=yes" >> $1 |
56 | |
57 | |
58 | cp $1 /etc/sysconfig/network-scripts/ |
59 | |
60 | |
61 | interface=$(echo $1 | awk -F - '{ print $2 }') |
62 | |
63 | /sbin/ifdown $interface 2>/dev/null |
64 | /sbin/ifup $interface 2>/dev/null |
65 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9