Skip to content

Commit

Permalink
Add quotes to tr constructs to fix command syntax (#20464)
Browse files Browse the repository at this point in the history
  • Loading branch information
spilkey-cisco authored Nov 18, 2024
1 parent ba48f43 commit daa5b03
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/base_image_files/TSA
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -f /etc/sonic/chassisdb.conf ] && [ "$SMARTSWITCH" = false ] ; then
fi
# toggle the mux to standby if dualtor and any mux active
if
[[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]] &&
[[ "$(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"
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/base_image_files/TSB
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -f /etc/sonic/chassisdb.conf ] && [ "$SMARTSWITCH" = false ] ; then
fi

# toggle the mux to auto if dualtor
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]];
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr '[:upper:]' '[:lower:]')" == *"dualtor"* ]];
then
logger -t TSB -p user.info "Toggle all mux mode to auto"
sudo config mux mode auto all
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/base_image_files/TSC
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
/usr/bin/TS TSC
[[ $1 != "no-stats" ]] && portstat -p 5

if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]]
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr '[:upper:]' '[:lower:]')" == *"dualtor"* ]]
then
echo
show mux status
Expand Down
2 changes: 1 addition & 1 deletion files/scripts/arp_update
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ while /bin/true; do
done

# find neighbor entries with aged MAC and flush/relearn them
STALE_NEIGHS=$(ip neigh show | grep -v "fe80" | grep "STALE" | awk '{print $1 "," $5}' | tr [:lower:] [:upper:])
STALE_NEIGHS=$(ip neigh show | grep -v "fe80" | grep "STALE" | awk '{print $1 "," $5}' | tr '[:lower:]' '[:upper:]')
for neigh in $STALE_NEIGHS; do
ip="$( cut -d ',' -f 1 <<< "$neigh" )"
mac="$( cut -d ',' -f 2 <<< "$neigh" )"
Expand Down

0 comments on commit daa5b03

Please sign in to comment.