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
31 lines
711 B
Bash
Executable File
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
|