7ae4a990e7
- Introduced TS common file in docker as well and moved common functions. - TSA/B/C scripts run only in BGP instances for front end ASICs. In addition skip enforcing it on route maps used between internal BGP sessions. admin@str--acs-1:~$ sudo /usr/bin/TSA System Mode: Normal -> Maintenance and in case of Multi-ASIC admin@str--acs-1:~$ sudo /usr/bin/TSA BGP0 : System Mode: Normal -> Maintenance BGP1 : System Mode: Normal -> Maintenance BGP2 : System Mode: Normal -> Maintenance
30 lines
858 B
Bash
Executable File
30 lines
858 B
Bash
Executable File
#!/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
|