2019-07-26 16:31:56 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-06-03 16:47:26 -05:00
|
|
|
# Restrict command to sudo users
|
|
|
|
if [ "$EUID" -ne 0 ] ; then
|
|
|
|
echo "Root priveleges are needed for this operation"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-04-28 03:28:06 -05:00
|
|
|
if [ -f /etc/sonic/chassisdb.conf ]; then
|
|
|
|
if [[ $1 == "no-stats" ]]; then
|
2023-06-03 16:47:26 -05:00
|
|
|
rexec all -c "sudo TSC no-stats"
|
2023-04-28 03:28:06 -05:00
|
|
|
else
|
2023-06-03 16:47:26 -05:00
|
|
|
rexec all -c "sudo TSC"
|
2023-04-28 03:28:06 -05:00
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
fi
|
2019-07-26 16:31:56 -05:00
|
|
|
|
2023-04-28 03:28:06 -05:00
|
|
|
/usr/bin/TS TSC
|
|
|
|
[[ $1 != "no-stats" ]] && portstat -p 5
|
2022-01-24 20:50:29 -06:00
|
|
|
|
|
|
|
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
show mux status
|
|
|
|
fi
|