2019-07-26 16:31:56 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "Traffic Shift Check:"
|
|
|
|
c=0
|
|
|
|
config=$(vtysh -c "show run")
|
|
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V4 permit 2"
|
2019-11-06 18:07:28 -06:00
|
|
|
c=$((c+$?))
|
2019-07-26 16:31:56 -05:00
|
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V4 deny 3"
|
2019-11-06 18:07:28 -06:00
|
|
|
c=$((c+$?))
|
2019-07-26 16:31:56 -05:00
|
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V6 permit 2"
|
2019-11-06 18:07:28 -06:00
|
|
|
c=$((c+$?))
|
2019-07-26 16:31:56 -05:00
|
|
|
echo "$config" | grep -q "route-map TO_BGP_PEER_V6 deny 3"
|
2019-11-06 18:07:28 -06:00
|
|
|
c=$((c+$?))
|
2019-07-26 16:31:56 -05:00
|
|
|
|
|
|
|
if [[ $c -eq 4 ]];
|
|
|
|
then
|
|
|
|
echo "System Mode: Normal"
|
|
|
|
elif [[ $c -eq 0 ]];
|
|
|
|
then
|
|
|
|
echo "System Mode: Maintenance"
|
|
|
|
else
|
|
|
|
echo "System Mode: Not consistent"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|