d5af096f41
* Rename asn/deployment_id_asn_map.yaml to constants/constants.yaml * Fix bgp templates * Add community for loopback when bgpd is isolated * Use correct community value
24 lines
635 B
Bash
Executable File
24 lines
635 B
Bash
Executable File
#!/bin/bash
|
|
|
|
c=0
|
|
config=$(vtysh -c "show run")
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V4 permit 2"
|
|
c=$((c+$?))
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V4 deny 3"
|
|
c=$((c+$?))
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V6 permit 2"
|
|
c=$((c+$?))
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V6 deny 3"
|
|
c=$((c+$?))
|
|
|
|
if [[ $c -eq 0 ]];
|
|
then
|
|
TSB_FILE=$(mktemp)
|
|
sonic-cfggen -d -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/bgpd.tsa.unisolate.conf.j2 > "$TSB_FILE"
|
|
vtysh -f "$TSB_FILE"
|
|
rm -f "$TSB_FILE"
|
|
echo "System Mode: Maintenance -> Normal"
|
|
else
|
|
echo "System is already in Normal mode"
|
|
fi
|