author | Florian Pose <fp@igh-essen.com> |
Mon, 29 Dec 2008 16:00:44 +0000 | |
branch | stable-1.4 |
changeset 1693 | 14e9266295a7 |
parent 1685 | 399ef727bf62 |
child 1363 | 11c0b2caa253 |
permissions | -rwxr-xr-x |
703 | 1 |
#!/bin/bash |
2 |
||
3 |
#------------------------------------------------------------------------------ |
|
4 |
# |
|
5 |
# $Id$ |
|
6 |
# |
|
1685
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
7 |
# Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH |
703 | 8 |
# |
9 |
# This file is part of the IgH EtherCAT Master. |
|
10 |
# |
|
1685
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
11 |
# The IgH EtherCAT Master is free software; you can redistribute it and/or |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
12 |
# modify it under the terms of the GNU General Public License version 2, as |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
13 |
# published by the Free Software Foundation. |
703 | 14 |
# |
1685
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
15 |
# The IgH EtherCAT Master is distributed in the hope that it will be useful, |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
16 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
17 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
18 |
# Public License for more details. |
703 | 19 |
# |
1685
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
20 |
# You should have received a copy of the GNU General Public License along |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
21 |
# with the IgH EtherCAT Master; if not, write to the Free Software |
703 | 22 |
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
23 |
# |
|
1685
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
24 |
# Using the EtherCAT technology and brand is permitted in compliance with the |
399ef727bf62
Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
703
diff
changeset
|
25 |
# industrial property and similar rights of Beckhoff Automation GmbH. |
703 | 26 |
# |
27 |
#------------------------------------------------------------------------------ |
|
28 |
||
29 |
# this ifup.d script adds special network interfaces to a network bridge |
|
30 |
||
31 |
CFGNAME=${1} |
|
32 |
IFNAME=${2} |
|
33 |
||
34 |
# customize here |
|
35 |
BRNAME="eoebr0" |
|
36 |
INTERFACES="" |
|
37 |
BRCTL="/sbin/brctl" |
|
38 |
LOGGER="logger -t ifup-eoe" |
|
39 |
||
40 |
# if the current interface in the list of interfaces to bridge? |
|
41 |
if ! echo ${INTERFACES} | grep -qw ${IFNAME}; then |
|
42 |
exit 0; |
|
43 |
fi |
|
44 |
||
45 |
# does the EoE bridge already exist? |
|
46 |
if ! ${BRCTL} show | grep -q "^${BRNAME}"; then |
|
47 |
${LOGGER} Creating ${BRNAME} |
|
48 |
${BRCTL} addbr ${BRNAME} # create it |
|
49 |
fi |
|
50 |
||
51 |
${LOGGER} Adding ${IFNAME} to ${BRNAME} |
|
52 |
ip link set ${IFNAME} down |
|
53 |
ip addr flush dev ${IFNAME} |
|
54 |
${BRCTL} addif ${BRNAME} ${IFNAME} |
|
55 |
ip link set ${IFNAME} up |
|
56 |
||
57 |
#------------------------------------------------------------------------------ |