Blame teamd/redhat/initscripts_systemd/network-scripts/ifdown-Team

Packit cac203
#!/bin/sh
Packit cac203
Packit cac203
# Copyright (C) 2012-2015 Jiri Pirko <jiri@resnulli.us>
Packit cac203
#
Packit cac203
# This library is free software; you can redistribute it and/or
Packit cac203
# modify it under the terms of the GNU Lesser General Public
Packit cac203
# License as published by the Free Software Foundation; either
Packit cac203
# version 2.1 of the License, or (at your option) any later version.
Packit cac203
#
Packit cac203
# This library is distributed in the hope that it will be useful,
Packit cac203
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit cac203
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit cac203
# Lesser General Public License for more details.
Packit cac203
#
Packit cac203
# You should have received a copy of the GNU Lesser General Public
Packit cac203
# License along with this library; if not, write to the Free Software
Packit cac203
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit cac203
Packit cac203
. /etc/init.d/functions
Packit cac203
Packit cac203
cd /etc/sysconfig/network-scripts
Packit cac203
. ./network-functions
Packit cac203
Packit cac203
[ -f ../network ] && . ../network
Packit cac203
Packit cac203
CONFIG=${1}
Packit cac203
Packit cac203
need_config "${CONFIG}"
Packit cac203
Packit cac203
source_config
Packit cac203
Packit cac203
if [ "${DEVICETYPE}" = "Team" ]; then
Packit cac203
	# This means that this was called directly, not via ifdown-eth
Packit cac203
	# so execute ifdown-eth now.
Packit cac203
	/etc/sysconfig/network-scripts/ifdown-eth ${CONFIG} $2
Packit cac203
fi
Packit cac203
Packit cac203
if [ -n "${TEAM_CONFIG}" ]; then
Packit cac203
	if [ ! -x /usr/bin/teamd ]; then
Packit cac203
		net_log $"Team support not available: teamd not found"
Packit cac203
		exit 1
Packit cac203
	fi
Packit cac203
	# Bring down all existing port devices now
Packit cac203
	for device in $(LANG=C egrep -l "^[[:space:]]*TEAM_MASTER=\"?${DEVICE}\"?" /etc/sysconfig/network-scripts/ifcfg-*) ; do
Packit cac203
		is_ignored_file "$device" && continue
Packit cac203
		/sbin/ifdown ${device##*/}
Packit cac203
	done
Packit cac203
	/usr/bin/systemctl stop teamd@${DEVICE}.service --ignore-dependencies || exit 1
Packit cac203
fi