Debian Codegraph @

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

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 [ -n "${TEAM_MASTER}" ]; then
33 if [ ! -x /usr/bin/teamdctl ]; then
34 net_log $"Team support not available: teamdctl not found"
35 exit 1
36 fi
37 /sbin/ip link show ${TEAM_MASTER} > /dev/null 2>&1
38 if [ $? -ne 0 ]; then
39 net_log $"Team master is not present, skipping port device removal from master" info
40 exit 0
41 fi
42 /usr/bin/teamdctl ${TEAM_MASTER} port remove ${DEVICE} || exit 1
43 fi
44
45 if [ "${DEVICETYPE}" = "TeamPort" ]; then
46 # This means that this was called directly, not via ifdown-eth
47 # so execute ifdown-eth now.
48 exec /etc/sysconfig/network-scripts/ifdown-eth ${CONFIG} $2
49 fi