File: libteam-utils.if-post-down.TESTME

package info (click to toggle)
libteam 1.31-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,344 kB
  • sloc: ansic: 17,494; sh: 1,242; python: 613; makefile: 102
file content (28 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

detach_slaves() {
	for slave in $TEAM_SLAVES ; do
		teamdctl $TEAM_MASTER port present $slave 2> /dev/null && \
			teamdctl $TEAM_MASTER port remove $slave
	done
}

kill_iface() {
	ip link del $TEAM_MASTER
}

if [ "$IF_TEAM_MASTER" ] ; then
	TEAM_MASTER="$IF_TEAM_MASTER"
	TEAM_SLAVES="$IFACE"
else
	if [ "$IF_TEAM_SLAVES" ] ; then
		TEAM_MASTER="$IFACE"
		TEAM_SLAVES="$IF_TEAM_SLAVES"
	fi
fi

[ -z "$TEAM_MASTER$TEAM_SLAVES" ] && exit

detach_slaves
kill_iface
exit 0