File tree 1 file changed +34
-1
lines changed
dockers/docker-teamd/base_image_files
1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
4
+
5
+ function help()
6
+ {
7
+ echo -e " Usage: $0 -n [0 to $(( $NUM_ASIC - 1 )) ] [OPTION]... " 1>&2 ; exit 1;
8
+ }
9
+
3
10
DOCKER_EXEC_FLAGS=" i"
4
11
5
12
# Determine whether stdout is on a terminal
6
13
if [ -t 1 ] ; then
7
14
DOCKER_EXEC_FLAGS+=" t"
8
15
fi
9
16
10
- docker exec -$DOCKER_EXEC_FLAGS teamd teamdctl " $@ "
17
+ DEV=" "
18
+ PLATFORM=${PLATFORM:- `sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
19
+
20
+ # Parse the device specific asic conf file, if it exists
21
+ ASIC_CONF=/usr/share/sonic/device/$PLATFORM /asic.conf
22
+ [ -f $ASIC_CONF ] && . $ASIC_CONF
23
+
24
+ if [[ ($NUM_ASIC -gt 1) ]]; then
25
+ while getopts " :n:h:" opt; do
26
+ case " ${opt} " in
27
+ h) help
28
+ ;;
29
+ n) DEV=${OPTARG}
30
+ [ $DEV -lt $NUM_ASIC -a $DEV -ge 0 ] || help
31
+ ;;
32
+ esac
33
+ done
34
+
35
+ if [ -z " ${DEV} " ]; then
36
+ help
37
+ fi
38
+
39
+ # Skip the arguments -n <inst> while passing to docker command
40
+ shift 2
41
+ fi
42
+
43
+ docker exec -$DOCKER_EXEC_FLAGS teamd$DEV teamdctl " $@ "
You can’t perform that action at this time.
0 commit comments