sonic-buildimage/dockers/docker-fpm-frr/TSB
judyjoseph 86a13610cb [docker-fpm-frr]: TSA/B/C changes for multi-asic (#6510)
- 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
2021-02-18 18:04:24 -08:00

31 lines
711 B
Bash
Executable File

#!/bin/bash
# Load the common functions
source /usr/bin/TS
check_installed
installed=$?
if [[ $installed -ne 0 ]];
then
TSB_FILE=$(mktemp)
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p');
do
is_internal_route_map $route_map_name && continue
case "$route_map_name" in
*V4*)
;;
*V6*)
;;
*)
continue
;;
esac
sonic-cfggen -d -a "{\"route_map_name\":\"$route_map_name\"}" -t /usr/share/sonic/templates/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 > "$TSB_FILE"
vtysh -f "$TSB_FILE"
rm -f "$TSB_FILE"
done
echo "System Mode: Maintenance -> Normal"
else
echo "System is already in Normal mode"
fi