30 lines
858 B
Plaintext
30 lines
858 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
# read SONiC immutable variables
|
||
|
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
|
||
|
|
||
|
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
|
||
|
|
||
|
# Parse the device specific asic conf file, if it exists
|
||
|
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf
|
||
|
[ -f $ASIC_CONF ] && . $ASIC_CONF
|
||
|
|
||
|
if [[ ($NUM_ASIC -gt 1) ]]; then
|
||
|
asic=0
|
||
|
NAMESPACE_PREFIX='asic'
|
||
|
|
||
|
while [ $asic -lt $NUM_ASIC ]
|
||
|
do
|
||
|
# Run TSA/TSB/TSC scripts in BGP instance for frontend ASICs.
|
||
|
sub_role=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['sub_role']" -n $NAMESPACE_PREFIX$asic`
|
||
|
if [ $sub_role == 'FrontEnd' ]
|
||
|
then
|
||
|
echo -e "BGP"$asic" : \c"
|
||
|
docker exec -i bgp$asic /usr/bin/$1
|
||
|
fi
|
||
|
asic=$[$asic+1]
|
||
|
done
|
||
|
else
|
||
|
docker exec -i bgp /usr/bin/$1
|
||
|
fi
|