Debian Codegraph @

teamd/redhat/initscripts/network-scripts/ifdown-Team

raw
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 if [ "${DEVICETYPE}" = "Team" ]; then
33 # This means that this was called directly, not via ifdown-eth
34 # so execute ifdown-eth now.
35 /etc/sysconfig/network-scripts/ifdown-eth ${CONFIG} $2
36 fi
37
38 if [ -n "${TEAM_CONFIG}" ]; then
39 if [ ! -x /usr/bin/teamd ]; then
40 net_log $"Team support not available: teamd not found"
41 exit 1
42 fi
43 # Bring down all existing port devices now
44 for device in $(LANG=C egrep -l "^[[:space:]]*TEAM_MASTER=\"?${DEVICE}\"?" /etc/sysconfig/network-scripts/ifcfg-*) ; do
45 is_ignored_file "$device" && continue
46 /sbin/ifdown ${device##*/}
47 done
48 /usr/bin/teamd -k -p /var/run/teamd-${DEVICE}.pid || exit 1
49 fi