2019-07-26 16:31:56 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-04-28 03:28:06 -05:00
|
|
|
if [ -f /etc/sonic/chassisdb.conf ]; then
|
|
|
|
rexec all -c "TSA chassis"
|
|
|
|
echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Maintenance after reboot\
|
|
|
|
or config reload on all linecards"
|
|
|
|
exit 0
|
|
|
|
fi
|
2022-07-31 00:16:58 -05:00
|
|
|
# toggle the mux to standby if dualtor and any mux active
|
|
|
|
if
|
|
|
|
[[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]] &&
|
|
|
|
[[ $(show mux status | grep active | wc -l) > 0 ]];
|
|
|
|
then
|
|
|
|
logger -t TSA -p user.info "Toggle all mux mode to standby"
|
|
|
|
sudo config mux mode standby all
|
2022-01-24 20:50:29 -06:00
|
|
|
fi
|
|
|
|
|
2022-07-31 00:16:58 -05:00
|
|
|
/usr/bin/TS TSA
|
2023-04-28 03:28:06 -05:00
|
|
|
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then
|
|
|
|
if [[ "$1" != "chassis" ]] ; then
|
|
|
|
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
|
|
|
|
echo -e "\nWARNING: Please execute 'TSA' on all other linecards of the chassis to fully isolate this device"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
|
|
|
|
fi
|