| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Copyright (C) 2012-2015 Jiri Pirko <[email protected]> |
| 4 |
# |
| 5 |
# This library is free software; you can redistribute it and/or |
| 6 |
# modify it under the terms of the GNU Lesser General Public |
| 7 |
# License as published by the Free Software Foundation; either |
| 8 |
# version 2.1 of the License, or (at your option) any later version. |
| 9 |
# |
| 10 |
# This library is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
# Lesser General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU Lesser General Public |
| 16 |
# License along with this library; if not, write to the Free Software |
| 17 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 |
|
| 19 |
. /etc/init.d/functions |
| 20 |
|
| 21 |
cd /etc/sysconfig/network-scripts |
| 22 |
. ./network-functions |
| 23 |
|
| 24 |
[ -f ../network ] && . ../network |
| 25 |
|
| 26 |
CONFIG=${1} |
| 27 |
|
| 28 |
need_config "${CONFIG}" |
| 29 |
|
| 30 |
source_config |
| 31 |
|
| 32 |
. /etc/sysconfig/teamd |
| 33 |
|
| 34 |
# If the device is a team, create it with teamd, if available. |
| 35 |
if [ -n "${TEAM_CONFIG}" ]; then |
| 36 |
if [ ! -x /usr/bin/teamd ]; then |
| 37 |
net_log $"Team support not available: teamd not found" |
| 38 |
exit 1 |
| 39 |
fi |
| 40 |
/usr/bin/teamd ${TEAMD_CMDLINE} -d -D -t ${DEVICE} -c "${TEAM_CONFIG}" -p /var/run/teamd-${DEVICE}.pid || exit 1 |
| 41 |
# Bring up all existing port devices now |
| 42 |
for device in $(LANG=C egrep -l "^[[:space:]]*TEAM_MASTER=\"?${DEVICE}\"?" /etc/sysconfig/network-scripts/ifcfg-*) ; do |
| 43 |
is_ignored_file "$device" && continue |
| 44 |
/sbin/ifup ${device##*/} |
| 45 |
done |
| 46 |
fi |
| 47 |
|
| 48 |
if [ "${DEVICETYPE}" = "Team" ]; then |
| 49 |
# This means that this was called directly, not via ifup-eth |
| 50 |
# so execute ifup-eth now. |
| 51 |
exec /etc/sysconfig/network-scripts/ifup-eth ${CONFIG} $2 |
| 52 |
fi |